Posted by peter on 12/09/06 09:05
> Thanks Rik! That seemed to have done the trick... What exactly do the {
> } do? Is there a good online reference you know about that I could
> learn some more? The few sites I've found are very vague on how
> variables work.. like strings integers, arrays etc.. I'm used to C++ so
> if I could find a comprehensive site that'd be great. Thanks again for
> your help Rik, you're a life saver!
the {} seperate the variable from the string which can be handy when the
variable does not have a spase after itfor example the following would cause
errors:-
<?PHP
$date = '9';
echo "Today is the $dateth";
?>
The script will be trying to find a variable called $dateth which does not
exist but if you do:-
<?PHP
$date = '9';
echo "Today is the {$date}th";
?>
In this case php now knows that $date is the variable
Navigation:
[Reply to this message]
|