Home >Backend Development >PHP Tutorial >Detailed explanation of boolean (Boolean) type in php_PHP tutorial
When converted to boolean, the following values are considered FALSE:
the Boolean value FALSE itself
the integer value 0 (zero)
the floating point value 0.0 (zero)
Empty string, and string "0"
Array containing no elements
An object that does not include any member variables (only applicable to PHP 4.0)
Special type NULL (including variables that have not been set)
SimpleXML object generated from an XML document without any tags
All other values are considered TRUE (including any resources).
Warning
-1, like other non-zero values (positive or negative), is considered TRUE!