I'm using L. Welling and L. Thomson's book to start learning PHP.
I have two syntax questions which they don't explain:
1) in the code:
echo 'Subtotal: $'.number_format($totalamount,2).'<br />';
I suppose that the first period is to concantenate the 'Subtotal'
string to the totalamount variable, and that the last one is to
concantenate the totalamount variable to the html tag. But why is
the dollar sign inside the first string? What is its purpose?
2) I know Pascal and can understand most of what is going on in
the C-like syntax, but the following line is Greek to me (and not
explained in the book). What do the question mark and the
double-colon mean? How do you read this statement?
echo ($char=="\n" ? '<br />': $char);
TIA,
--
Brad Blanchard
Website: http//www.braser.com
email accepted from the website
>> Stay informed about: Syntax question from a beginner