Which PHP function checks whether a specified value exists in an array?

Options

  • A. is_array()
  • B. in_array()
  • C. count()
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

B. in_array()

Detailed Explanation

Correct Answer: Option B

Explanation:
in_array($value, $array) checks whether a value exists in an array. In contrast, is_array($variable) checks the type of a variable. These functions have different purposes.