is_null

(PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8)

is_null 检测变量是否是 null

说明

is_null(mixed $value): bool

检测变量是否是 null

参数

value

需要检测的变量。

返回值

如果 valuenull,返回 true,否则返回 false

范例

示例 #1 is_null() 示例

<?php

error_reporting
(E_ALL);

$foo = NULL;
var_dump(is_null($inexistent), is_null($foo));

?>
Notice: Undefined variable: inexistent in ...
bool(true)
bool(true)

参见

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top