There are two ways to get your variables into a string -- concatenation with
single-quoted strings, or embedding in evaluated double-quoted strings.
Which is more expensive to the server?

For example:

<?php

$x = 10;
echo "This is a string and my variable \$x is $x.\n";
echo 'This is a string and my variablke $x is '.$x."\n";

?>

Now, which is more expensive? Is it more expensive to concatenate them, or
to evaluate the whole string since it would be in double-quotes? I see lots
of people do things in double-quotes, but it would seem to me that
single-quoted strings concatenated with variables would be less expensive
because you are only evaluating the variables.

--Jason


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to