Boolean values : boolean « Data Type « PHP






Boolean values

<?
$a=100;
if($a==100) {
    echo "the variable equals 1!<br>";
}

if($a==true) {
   echo "the variable is true!<br>";
}
?>


           
       








Related examples in the same category

1.Converting from a boolean to a string will produce a 1 if the boolean is set to true, or an empty string if false.
2.PHP provides a couple of constants especially for use as Booleans: TRUE and FALSE
3.Boolean type constant: FALSE