1The 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.
1Booleans can be one of two constants:
2true
3false
4These values are not case sensitive, therefore true is the same as TRUE
5
6booleans are also often used in control structures, either directly or as
7a result of an operation. For example:
8
9if ($waterDrankToday > 3.7) {
10 echo "Good work staying hydrated!";
11 if ($havingABadDay)
12 hug();
13}
14else
15 echo "You should drink more water";