Boolean contains TRUE or FALSE value, which is specificly used in if statements that is one of the baces in control structure.
Boolean provides constants that are TRUE and FALSE
Interpreting other Types as Booleans
there are also some cases that are interpreted as TRUE or False values when they act like a Boolean type such as using them in if statements.
- if the value is a number it is true if it is a number exept zero
- if the value is a string it is true exept if it has zero of charachters or it is a charachter containing just this”0″
- values of type NULL are always false
- if the value is compund type such as array or an object of a class it is TRUE if it has a value and it is false if it has no other values .for an object of a class containing a value means having a member variable that has been assigned a value
$TrueString = "this contains strings of charachters";
$TrueArray = 77;
$FalseString = "";
$FalseArray = array()
$FalseNull = NULL