PHP is_bool() Function
is_bool() The function is used to check whether a variable is of boolean type.
PHP version requirement: PHP 4, PHP 5, PHP 7
Syntax
bool is_bool ( mixed $var )
Parameter Description:
- $var: the variable to check.
Return Value
If var is boolean, returns TRUE.
Example
Example
The output is:
变量 a 是布尔型
Available PHP Functions