0

Why it is a syntax error?

$x=25 if(30>$x>20) echo "30"; else echo "$x";

12th Oct 2017, 3:20 AM
karthik
karthik - avatar
2 Answers
+ 5
$x=25; // Missing semicolon if(30 > $x && $x > 20) // PHP doesn't allow comparison chaining in the manner you're using echo "30"; else echo "$x";
12th Oct 2017, 3:49 AM
ChaoticDawg
ChaoticDawg - avatar