|
代码如下:
[U]复制代码[/U] 代码如下:
首先是empty的var_dump输出:
boolean true
boolean true
boolean true
boolean true
boolean true
boolean true
然后是is_null的输出:
boolean true
boolean false
boolean false
boolean false
boolean true
boolean false
最后是isset的输出:
boolean false
boolean true
boolean true
boolean true
boolean false
boolean true
由此可见 empty() 可以用来判定所有的数据类型是否为空或假,而 is_null 与 isset 基本一样,只能用来判断是否为NULL和未定义.
您可能感兴趣的文章:php empty,isset,is_null判断比较(差异与异同)php中is_null,empty,isset,unset 的区别详细介绍深入PHP empty(),isset(),is_null()的实例测试详解一张表搞清楚php is_null、empty、isset的区别PHP中empty,isset,is_null用法和区别
|
|