小白教程
所有教程
关于
Search
108.162.216.57
108.162.216.57
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Php is null function”的源代码
本页内容
上一节:
Php_is_int_function
下一节:
Php_is_numeric_function
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:is_null}}[[Category:php variable handling functions|20]] = PHP is_null() 函数 = [[php variable handling functions|PHP 可用的函数]] '''is_null()''' 函数用于检测变量是否为 NULL。 PHP 版本要求: PHP 4 >= 4.0.4, PHP 5, PHP 7 === 语法 === <sample title="" desc="" lang="php" hererun="1"> bool is_null ( mixed $var ) </sample> 参数说明: * $var:要检测的变量。 === 返回值 === 如果指定变量为 NULL,则返回 TRUE,否则返回 FALSE。 == <sample title="" desc="" lang="php" hererun="1"> <?php $var_name = TRUE; $var_name2 = NULL; if (is_null($var_name)) { echo '变量 var_name 为 NULL' . PHP_EOL; } else { echo '变量 var_name 不为 NULL' . PHP_EOL; } if (is_null($var_name2)) { echo '变量 var_name2 为 NULL' . PHP_EOL; } else { echo '变量 var_name2 不为 NULL' . PHP_EOL; } ?> </sample> 输出结果为: <sample title="" desc="" lang="php" hererun="1"> 变量 var_name 不为 NULL 变量 var_name2 为 NULL </sample> [[php variable handling functions|PHP 可用的函数]]
返回至“
Php is null function
”。
上一节:
Php_is_int_function
下一节:
Php_is_numeric_function