PHP is_bool() Function

PHP Variable Handling Reference : Check whether a variable is a boolean or not

Definition and Usage

The is_bool() function checks whether a variable is a boolean or not.

This function returns true (1) if the variable is a boolean, otherwise it returns false/nothing.

Syntax

is_bool(variable);

Parameter Values

Parameter Description
variable Required. Specifies the variable to check

Technical Details

Return Value: TRUE if variable is a boolean, FALSE otherwise
Return Type: Boolean
PHP Version: 4.0+

❮ PHP Variable Handling Reference