How can we find or count number of elements in an array?

Last updated 2 years, 4 months ago | 310 views 75     5

There are two ways to find number of elements in an array:

1. sizeof($arr), This function is an alias of count()

echo sizeof($arr);

2. count($arr)

echo count($arr);