src/Admin/CoreAdmin.php
private static function arrayDepth($array, $level = 0)
    {
        if (!$array) {
            return $level;
        }

        if (!is_array($array)) {
            return $level;
        }

        ++$level;
        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $level = $level < self::arrayDepth($value, $level) ? self::arrayDepth($value, $level) : $level;
            }
        }

        return $level;
    }
private static function arrayDepth($array, $level = 0)
    {
        if (!$array) {
            return $level;
        }

        if (!is_array($array)) {
            return $level;
        }

        ++$level;
        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $level = $level < self::arrayDepth($value, $level) ? self::arrayDepth($value, $level) : $level;
            }
        }

        return $level;
    }
private static function arrayDepth ( $ array , $ level = 0 ) { if ( ! $ array ) { return $ level ; } if ( ! is_array ( $ array ) ) { return $ level ; } ++ $ level ; foreach ( $ array as $ key => $ value ) { if ( is_array ( $ value ) ) { $ level = $ level < self :: arrayDepth ( $ value , $ level ) ? self :: arrayDepth ( $ value , $ level ) : $ level ; } } return $ level ; }
Returns the level of depth of an array.

@param array $array
@param int   $level : do not use, just used for recursivity

@return int : depth
Returns the level of depth of an array .