Originally Posted by pross
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;
Well, difference between single and double quotes is that double quotes get parsed, while single quotes do not. Ie. that if you do not need PHP to parse your strings, you should NOT use double quotes.
You should also not use [dot] to concat strings, much faster is to use comma, as it does not concat them, but just echoes them.
So, this is fastest:
echo '1', $itemid;
This is slower:
And this would be slowest:
All those examples produce same result, of course.