is_bool

(PHP 4 , PHP 5)

is_bool --  変数がbooleanであるかを調べる

説明

bool is_bool ( mixed var)

パラメータvarbooleanである 場合にTRUEを返します。

例 1. is_bool()の例

<?php
$a
= false;
$b = 0;

// Since $a is a boolean, this is true
if (is_bool($a)) {
    print
"Yes, this is a boolean";
}

// Since $b is not a boolean, this is not true
if (is_bool($b)) {
    print
"Yes, this is a boolean";
}
?>

is_array(), is_float(), is_int(), is_integer(), is_string(), is_object()も参照下さい。