Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to convert all kinds of data in PHP? What I asked was not the form, but the rules of conversion, such as why the character "100" changed when it was converted to Boolean.
How to convert all kinds of data in PHP? What I asked was not the form, but the rules of conversion, such as why the character "100" changed when it was converted to Boolean.
When converted to a Boolean value, the following values are considered FALSE:

1, Boolean value FALSE itself.

2. The integer value is 0 (zero)

3. An empty string with a floating-point value of 0.0 (zero) and the string "0"

4. An array that contains no elements

5. Objects that do not contain any member variables (PHP 4.0 only)

6. Special type NULL (including variables that have not been set)

7. SimpleXML objects generated from XML documents without any tags.