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

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -