Home >Backend Development >PHP Tutorial >Introduction to Boolean types in PHP
Some details to pay attention to: When converted to boolean, the following values are considered FALSE: 1. the Boolean value FALSE itself 2. the integer value 0 (zero) 3. The floating point value 0.0 (zero), the empty string, and the string "0" 4. Array not containing any elements 5. Objects that do not include any member variables (only applicable to PHP 4.0) 6. Special type NULL (including variables that have not been set) 7. SimpleXML objects generated from XML documents without any tags Example:
Output results: bool(false) bool(false) Empty 0 is converted to false by default, success! |