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