Which function is used to determine whether the variable’s value is either TRUE or FALSE?
Correct answer
D. is_bool()
11 views
D. is_bool()
11 views
is_bool() tests whether a variable holds a boolean value, returning true only when the value is exactly true or false. A value such as 0, 1 or an empty string is not a boolean, even though it can be converted to one.
boolean(), is_boolean() and bool() are not PHP functions.
For more solved questions like this one, see Computer Science MCQs on MCQsExam.com.
Not sure why the answer is D? Ask here and get an explanation.