How to count the length of the PHP array?
You can use the count() function to count the length of the specified array. The sizeof() function is an alias for the count() function. The count() function takes two arguments, a list and a length count mode for nested arrays.
Where:
- array: specifies an array to count
- mode (Optional): specifies the counting mode. Possible values:
0 - is the default. It doesn't count all elements of multidimensional arrays
1 - Counts an array recursively (counts all elements of multidimensional arrays)