public function array_depth($array)
    {
        $max_depth = 1;
        foreach ($array as $value) {
            if (is_array($value)) {
                $depth = $this->array_depth($value) + 1;
                if ($depth > $max_depth) {
                    $max_depth = $depth;
                }
            }
        }
        return $max_depth;
    }
public function array_depth($array)
    {
        $max_depth = 1;
        foreach ($array as $value) {
            if (is_array($value)) {
                $depth = $this->array_depth($value) + 1;
                if ($depth > $max_depth) {
                    $max_depth = $depth;
                }
            }
        }
        return $max_depth;
    }
public function array_depth ( $ array ) { $ max_depth = 1 ; foreach ( $ array as $ value ) { if ( is_array ( $ value ) ) { $ depth = $ this -> array_depth ( $ value ) + 1 ; if ( $ depth > $ max_depth ) { $ max_depth = $ depth ; } } } return $ max_depth ; }
This returns the depth of an array

@param array $array
@return int
This returns the depth of an array