Home >Backend Development >PHP Tutorial >php converting to boolean

php converting to boolean

WBOY
WBOYOriginal
2016-06-23 14:36:101002browse

When converting to boolean, the following values are considered FALSE:

the boolean FALSE itself the integer 0 (zero) the float 0.0 (zero) the empty string, and the string "0" an array with zero elements an object with zero member variables (PHP 4 only) the special type NULL (including unset variables) SimpleXML objects created from empty tags

Every other value is considered TRUE (including any resource).

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP echo [转]Next article:{php 变量}