How can we count the number of elements in an array?

Options
- Using sizeof()
- count()
- Writing a user defined function and using array_search()
- Both a and b


CORRECT ANSWER : Both a and b

Discussion Board
Count

Answer : Both a and b above.

The count() function returns the number of elements in an array.
The sizeof() function returns the number of elements in an array.

Syntax :
count(array,mode);
sizeof(array,mode);

IamJay 02-9-2015 06:22 AM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement