src/Utilities/Arrays.php
public static function getDimensionsCount(array $array)
    {
        /*
         * No elements?
         * Nothing to do
         */
        if (empty($array)) {
            return 0;
        }

        $dimensionsCount = 1;

        foreach ($array as $value) {
            if (is_array($value)) {
                /*
                 * I have to increment returned value, because that means we've got 1 level more (if the value is an
                 * array)
                 */
                $count = self::getDimensionsCount($value) + 1;

                if ($count > $dimensionsCount) {
                    $dimensionsCount = $count;
                }
            }
        }

        return $dimensionsCount;
    }
public static function getDimensionsCount(array $array)
    {
        /*
         * No elements?
         * Nothing to do
         */
        if (empty($array)) {
            return 0;
        }

        $dimensionsCount = 1;

        foreach ($array as $value) {
            if (is_array($value)) {
                /*
                 * I have to increment returned value, because that means we've got 1 level more (if the value is an
                 * array)
                 */
                $count = self::getDimensionsCount($value) + 1;

                if ($count > $dimensionsCount) {
                    $dimensionsCount = $count;
                }
            }
        }

        return $dimensionsCount;
    }
public static function getDimensionsCount ( array $ array ) { /*
         * No elements?
         * Nothing to do
         */ if ( empty ( $ array ) ) { return 0 ; } $ dimensionsCount = 1 ; foreach ( $ array as $ value ) { if ( is_array ( $ value ) ) { /*
                 * I have to increment returned value, because that means we've got 1 level more (if the value is an
                 * array)
                 */ $ count = self :: getDimensionsCount ( $ value ) + 1 ; if ( $ count > $ dimensionsCount ) { $ dimensionsCount = $ count ; } } } return $ dimensionsCount ; }
Returns count of dimensions, maximum nesting level actually, in given array

@param array $array The array to verify
@return int
Returns count of dimensions maximum nesting level actually in given array