is_bool(value) returns true if value is a Boolean.
PHP is_bool() function has the following syntax.
is_bool(value)
Returns true if value is a Boolean.
Is it a boolean value?
<?php
$values = array(2, "2", 2.5, "2.5", null, true);
foreach ($values as $value) {
echo "is_bool(";
var_export($value);
echo ") = ";
var_dump(is_bool($value));
}
?>
The code above generates the following result.