PHP is_null() 函数
PHP 教程
· 2019-01-31 18:59:50
is_null() 函数用于检测变量是否为 NULL。
PHP 版本要求: PHP 4 >= 4.0.4, PHP 5, PHP 7
语法
bool is_null ( mixed $var )
参数说明:
- $var:要检测的变量。
返回值
如果指定变量为 NULL,则返回 TRUE,否则返回 FALSE。
实例
实例
$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;
}
输出结果为:
变量 var_name 不为 NULL 变量 var_name2 为 NULL
点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html
Mobilizing Web Sites
Layon, Kristofer / 2011-12 / 266.00元
Everyone has been talking about the mobile web in recent years, and more of us are browsing the web on smartphones and similar devices than ever before. But most of what we are viewing has not yet bee......一起来看看 《Mobilizing Web Sites》 这本书的介绍吧!