View Single Post
Old 06-05-2005, 02:03 AM   #3 (permalink)
jaswinder_rana
The Acquainted
 
Join Date: May 2005
Posts: 106
Thanks: 0
jaswinder_rana is on a distinguished road
Default

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
Send a message via MSN to jaswinder_rana
jaswinder_rana is offline  
Reply With Quote