Which PHP function returns the number of elements in an array?

Options

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

Correct Answer (Detailed Explanation is Below)

B. count()

Detailed Explanation

Correct Answer: Option B

Explanation:
The PHP count() function returns the number of elements in an array. The is_array() function only checks whether a variable is an array; it does not count the elements.