View Single Post
Old 08-27-08, 12:14 PM   #25
ViN86
 
Join Date: Mar 2004
Posts: 15,486
Default Re: Learn PHP/MySQL Feedback Thread

Quote:
Originally Posted by pross View Post
nice thread so far mate, i have only one small concern so far; you are using double quotes in your variables, tho this is ok to do and works fine it can lead to hassles later especially if you want to include a double quote in the html output, for example..

$test = "hello";
$output = "<a href="http://someurl.com">" . $test;

the above snippet will break unless the double quotes inside the html link are escaped with a \

single quotes however do not have this problem..

$test = 'hello';
$output = '<a href="http://someurl.com">' . $test;
yes, good point.

i typically use double quotes and escape them when i want them in the HTML. but single quotes would probably be a better idea.
ViN86 is offline   Reply With Quote