请输入您要查询的百科知识:

 

词条 is_bool
释义

is_bool

(PHP 4 )

is_bool -- 检测变量是否是布尔型

描述

bool is_bool ( mixed var)

如果 varboolean 则返回 TRUE

is_bool()示例

<?php

$a = false;

$b = 0;

// 因为 $a 是布尔型,所以结果为真

if (is_bool($a)) {

print "Yes, this is a boolean";

}

// 因为 $b 不是布尔型,所以结果为非真

if (is_bool($b)) {

print "Yes, this is a boolean";

}

?>

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/3/22 6:05:39