PHP is_bool() Function
The is_bool() Function in PHP is used to find whether a variable is a Boolean or not. It returns a Boolean value true if the parameter var is a Boolean else it returns false.
Syntax
is_bool ( mixed $var )
Parameter
var(required)- This parameter represents the variable being evaluated.
Return
This function returns a Boolean value TRUE if the parameter ‘var’ is a Boolean, else it returns FALSE.
Example 1
Output
The given variable is a Boolean value.
Example 2
Output
The given variable is a Boolean value.
Example 3
Output
The given variable is not a Boolean value.
Example 4
Output
The given variable is not a Boolean value.