WiZ, I'm a little confused by your advice here:
by the way i recommend use like that(simply):
Code: Select all
echo ("<a href="profile.php?profile=" . $profileuser . ">");
First of all, if you're using dot-concatenation, why are you using double quotes? Double-quotes force PHP to parse everything in the string, but if you don't have any variables or escape-characters (e.g. "\n" or "\t") in it, then by using double quotes you're just forcing it to do unnecessary processing. In other words, using single-quotes when you can tends to be marginally faster.
Secondly, why are you recommending that the poster add parentheses around the argument for echo? To quote the documentation
echo() is not actually a function (it is a language construct) so you are not required to use parentheses with it. In fact, if you want to pass more than one parameter to echo, you must not enclose the parameters within parentheses.
So parentheses is not the recommended usage and, in fact, it probably causes PHP to do an extra bit of unnecessary processing because it has to add another parenthese to the stack (the same is true for print, I believe). And using parentheses also keeps you from using the syntax echo $a, $b;
, which I'm told is marginally faster than echo $a . $b;
Anyway, sorry for all the questions. I was just curious about your recommendations.