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

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

c# - Avoiding duplicate methods for Task and Task<T> -

javascript - Which segment of a polyline was clicked? -