To count the number of elements in an array, We can use count() function which is provided in PHP official library. You can also use sizeof() function which is alias of count(). For example, we have an array which is declared like the followings :
$arr = array(0,
   false, 
   "string",
   null,
   array("res1","res2",array("resres1"))
  );
which will be printed out :
Array
(
    [0] => 0
    [1] => 
    [2] => string
    [3] => 
    [4] => Array
        (
            [0] => res1
            [1] => res2
            [2] => Array
                (
                    [0] => resres1
                )

        )

)
For normal count:
echo count($arr);
we will see the result is 5. but in COUNT_RECURSIVE mode
echo count($arr, COUNT_RECURSIVE);
the result is 9.

You can see that COUNT_RECURSIVE mode means all elements in multidimensional array will be counted.