Thread: Web template
View Single Post
  #14 (permalink)  
Old Sep 6th, 2007, 17:58
ccandeland ccandeland is offline
Junior Member
Join Date: Aug 2007
Location: uk
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Web template

Quote:
Originally Posted by Rakuli View Post
A pedantic point but when you're echoing html with PHP it is better (faster) to use single quotes unless you plan to embed variables in them.

With single quotes php will simply output the text but with double quotes it checks the whole string to see if anything needs interpreting before outputting.

As pa007 says you do have to escape single quotes with \'

Cheers.
I had some trouble escaping the single qoutes when I echoed html the backslash appeared in the html along with the single quotation. I removed the backslash and it was ok after that. I read a bit about it here: http://www.tizag.com/phpT/echo.php

Will it cause problems across other browsers without escaping. i am currently using firefox.

Chris
Reply With Quote