parse error: syntax error expecting ";" or "," on line 4

what is wrong with this code

<?php $number = 16; if ($number < 10) { echo “$number is less than ten”; } else { echo “$number is more than ten”; } ?>

Problem is in double quotes. Yours are not standard, see the difference:

incorrect:[php]echo “$number is less than ten”;[/php]
correct:[php]echo “$number is less than ten”;[/php]

You can also use single quotes.

Sponsor our Newsletter | Privacy Policy | Terms of Service