0
Why it is a syntax error?
$x=25 if(30>$x>20) echo "30"; else echo "$x";
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";
$x=25 if(30>$x>20) echo "30"; else echo "$x";