Parse error: syntax error, unexpected T_IF on line 9


whats wrong with this piece of code?
I cant even get the error.:frowning:

        $items =30     // Set this to a number greater than 5!
        if($items > 5) {
          echo "You get a 10% discount!";


$items > 5==true // one or other ;)

compare this

$items > 5

Or compare this

$items == true

If you wann compare more than one value you should use && or || you can read more about it
here Comparsion operators


yea that was wrong i just saw it on one of answers and gave it a try...but do you understand the ERROR?


List of Parser Tokens

There you can read what T_IF means. As Example wrong comparsion operators throws that error.


yea got it thank you...its funny if it founds a statement without a semicolon at the end it picks on IF statement:D and im stupid..thank you


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.