IS_BOOL(3) 1 IS_BOOL(3)
is_bool - Finds out whether a variable is a boolean
SYNOPSIS
bool is_bool (mixed $var)
DESCRIPTION
Finds whether the given variable is a boolean.
PARAMETERS
o $var
- The variable being evaluated.
RETURN VALUES
Returns TRUE if $var is a boolean, FALSE otherwise.
EXAMPLES
Example #1
is_bool(3) examples
<?php
$a = false;
$b = 0;
// Since $a is a boolean, it will return true
if (is_bool($a) === true) {
echo "Yes, this is a boolean";
}
// Since $b is not a boolean, it will return false
if (is_bool($b) === false) {
echo "No, this is not a boolean";
}
?>
SEE ALSO
is_float(3), is_int(3), is_string(3), is_object(3), is_array(3).
PHP Documentation Group IS_BOOL(3)