Converting from a boolean to a string will produce a 1 if the boolean is set to true, or an empty string if false. : boolean « Data Type « PHP






Converting from a boolean to a string will produce a 1 if the boolean is set to true, or an empty string if false.

 
<?
    $bool = true;
    print "Bool is set to $bool\n";
    $bool = false;
    print "Bool is set to $bool\n";
?>
  
  








Related examples in the same category

1.PHP provides a couple of constants especially for use as Booleans: TRUE and FALSE
2.Boolean values
3.Boolean type constant: FALSE