src/Helper/Arr.php
public static function flatten(array $array)
    {
        $out = [];

        foreach (new RecursiveIteratorIterator(new RecursiveArrayIterator($array)) as $key => $item) {
            if (is_int($key)) {
                $out[] = $item;
            } else {
                $out[$key] = $item;
            }
        }

        return $out;
    }
public static function flatten(array $array)
    {
        $out = [];

        foreach (new RecursiveIteratorIterator(new RecursiveArrayIterator($array)) as $key => $item) {
            if (is_int($key)) {
                $out[] = $item;
            } else {
                $out[$key] = $item;
            }
        }

        return $out;
    }
public static function flatten ( array $ array ) { $ out = [ ] ; foreach ( new RecursiveIteratorIterator ( new RecursiveArrayIterator ( $ array ) ) as $ key => $ item ) { if ( is_int ( $ key ) ) { $ out [ ] = $ item ; } else { $ out [ $ key ] = $ item ; } } return $ out ; }
Flattens a multidimensional array.

@param array $array

@return array
Flattens a multidimensional array .