合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
PHP 中以下值得计算结果为 false: | 关键字 | boolean | false | | --- | --- |--- | | 整型 | integer | 0 | | 浮点型 | double | 0.0 | | 字符串 | string | ""  | | 字符串 | string  | "0"  | | 数组 | array  | array()  | | 对象  | object  | 空对象 php<5  | | null  | null  | NULL  | ![](https://box.kancloud.cn/215eaddd17457138a66a7dbe9ef362fb_804x341.png) ![](https://box.kancloud.cn/932be04d6a1aee6540cac85e65d26002_734x369.png) ![](https://box.kancloud.cn/847c6bc3f680db9de2f4ad64332a566a_616x332.png) ![](https://box.kancloud.cn/4593ac4f05c844ef5515a9e7f9130ceb_751x363.png) 正确地检查一个变量是否为空应该使用: ~~~ <?php if (empty($var)) { ... } ~~~