PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<is_arrayis_callable>
Last updated: Mon, 16 Jul 2012

is_bool

(PHP 4, PHP 5)

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

描述

bool is_bool ( mixed var )

如果 varboolean 则返回 TRUE

例子 1. 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";
}
?>

参见 is_array()is_float()is_int()is_integer()is_string()is_object()




<is_arrayis_callable>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST