PHP Booleans
By S.Tanveer
Published: 14 Aug 2005
Operators In PHP
PHP Booleans
True and False these tow or some special meaning and called Boolean values. True is usually given a value of 1 and False is given a value of zero. You can initialize the values as :
$true_value = 1;
$false_value = 0;
You can replace the 1 and 0 with the words "true" and "false" (without the quotes).
The out put is very simple
True value=1
False value=
False value print nothing.
You can also compare the True value and False value in If statement in following way
$value = true; if ($value) { echo "This is True"; }
This is a short cut method of writing if( $value==True).