PHP is_null() Function
is_null() The function is used to check whether a variable is NULL.
PHP version requirement: PHP 4 >= 4.0.4, PHP 5, PHP 7
Syntax
bool is_null ( mixed $var )
Parameter Description:
- $var: the variable to check.
Return Value
If the specified variable is NULL, returns TRUE; otherwise returns FALSE.
Example
Example
The output is:
变量 var_name 不为 NULL
变量 var_name2 为 NULL
Available PHP Functions