1. Home
  2. Computer Science MCQs
  3. PHP
  4. Which function is used to determine whether the variable’s…

Added 22 Jan 2024

Which function is used to determine whether the variable’s value is either TRUE or FALSE?

  1. boolean()
  2. is_boolean()
  3. bool()
  4. is_bool() Correct answer

Correct answer

D. is_bool()

11 views

MCQSEXAM

Explanation

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.

Doubts & discussion

Not sure why the answer is D? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More PHP MCQs

Practise all PHP MCQs

Similar MCQs