In PHP, when other type variables are converted to boolean, the following value is considered FALSE:
Boolean value FALSE itself;
Integer value 0 (zero);
Floating point value 0.0 (zero);
Empty string (""), and string ("0") ;
An array that does not contain any elements;
An object that does not contain any member variables (only applicable to PHP 4.0);
The special type NULL (including variables that have not been set);
Never has any tags SimpleXML object generated from an XML document (tags);
All other values are considered TRUE (including any resources).
Note: -1, like other non-zero values (positive or negative), is considered TRUE!
var_dump((bool) ""); // bool(false)
var_dump((bool) 1); // bool(true)
var_dump((bool) -2); // bool (true)
var_dump((bool) "foo"); // bool(true)
var_dump((bool) 2.3e5); // bool(true)
var_dump((bool) array( 12)); // bool(true)
var_dump((bool) array()); // bool(false)
var_dump((bool) "false"); // bool(true)
?>