Q. Which of the following is the correct way to get the number of elements in an array?

  • (A) length($array)
  • (B) count($array)
  • (C) size($array)
  • (D) sizeofarray($array)
πŸ’¬ Discuss
βœ… Correct Answer: (B) count($array)
Explanation: count() returns the number of elements in an array. sizeof() also works as an alias.
Explanation by: Rati Dubey
count() returns the number of elements in an array. sizeof() also works as an alias.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
70
Total Visits
πŸ“½οΈ
12 mo ago
Published
πŸŽ–οΈ
Rati Dubey
Publisher
πŸ“ˆ
99%
Success Rate