首頁 >後端開發 >php教程 >php converting to boolean

php converting to boolean

WBOY
WBOY原創
2016-06-23 14:36:101005瀏覽

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).

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
上一篇:PHP echo [转]下一篇:{php 变量}