In PHP . is used for concatination. Personally I would prefer + be the operator for combining strings as it is in java, maybe somewhere along the line they'll incorporate C++ operator redefining. Anyways... here's the code:
PHP Code:
<?php
$msg = 'Hello';
$msg .= '<br />World';
echo $msg;
?>
$msg .= 'world' is a shortcut for $msg = $msg . 'world'. Also in the code you posted you did not put all of your code within the start and end tags ( <?php ?> )
Edit:
I guess chrishirst beat me to it. You win this time 
Last edited by NullPointer; 10-22-2008 at 12:19 PM..
|