public static function count(array $array)
    {
        $count = 0;

        foreach ($array as $v) {
            if (is_array($v)) {
                $count += self::count($v);
            } else {
                $count++;
            }
        }
        
        return $count;
    }
public static function count(array $array)
    {
        $count = 0;

        foreach ($array as $v) {
            if (is_array($v)) {
                $count += self::count($v);
            } else {
                $count++;
            }
        }
        
        return $count;
    }
public static function count ( array $ array ) { $ count = 0 ; foreach ( $ array as $ v ) { if ( is_array ( $ v ) ) { $ count += self :: count ( $ v ) ; } else { $ count ++ ; } } return $ count ; }
Count array items recursively

@param   array
@return  int
Count array items recursively