06-05-2005, 02:03 AM
|
#3 (permalink)
|
|
The Acquainted
Join Date: May 2005
Posts: 106
Thanks: 0
|
Commas in echo
This might be the first time you are seeing this. you can echo something like
PHP Code:
$str = 'sentence.';
echo 'This ','is ','a ',$str;
it'll print This is a senetence.. Yes, it works like concatenation but it does not concate strings, it just print everything to buffer.
and if you do
PHP Code:
$str = 'sentence.';
echo 'This '.'is '.'a '.$str;
while using periods, it'll first concatenate strings and then print them out.
So, using commas is more faster than using periods.
Note: it only works in echo.
YOU CANNOT DO THIS::
$str = 'This ','is ','a ','sentence.';//THIS IS WRONG SYNTAX
__________________
---------------------------
Errors = Improved Programming.
Portfolio
|
|
|