超越PHP PHP动态 | 经典文章 | CLASS | 相关下载 | 常见问题 | FORUM | WIKI | 在线手册
Site search:    
<is_longis_numeric>
Last updated: Fri, 22 Jun 2007

is_null

(PHP 4 >= 4.0.4, PHP 5)

is_null --  检测变量是否为 NULL

描述

bool is_null ( mixed var)

如果 varnull 则返回 TRUE,否则返回 FALSE

查看 NULL 类型获知变量什么时候被认为是 NULL,而什么时候不是。

参见 NULLis_bool()is_numeric()is_float()is_int()is_string()is_object()is_array()is_integer()is_real()




add a note add a note User Contributed Notes
is_null
uioreanu at hotmail dot com
23-Mar-2001 10:36
Don't try to test
if ($intSomething==NULL) {
...
}
use is_null() instead.
The first statement misses 0 values.

Regards,
Calin

[Ed. note: this is because == tests for equivalence of value, but not type. NULL evaluates to
false, as does 0, so NULL == 0 is true--even though 0 is type int and NULL is type null.
You should use either is_null() as noted or ===, which returns true only if its operands are
equal and of the same type.]

<is_longis_numeric>
 Last updated: Fri, 22 Jun 2007
view source | feedback | send page | sitemap | aboutus   
Copyright ® 2002-2003 PHPE.NET. All rights reserved
Last updated:2002-11-22