PHP - print the result of a boolean expression -
i expect following code print "false"
<?php $a = 4; $b = 45; echo $a==$b; ?>
but prints nothing.
it doesn't print because result of $a==$b
boolean, , false
converted empty string. use var_dump
instead (if debugging code):
var_dump($a==$b);
or alternatively can use echo
way:
echo ($a==$b) ? 'true' : 'false';
Comments
Post a Comment