public function flatter($array)
    {
        $result = [];
        foreach ($array as $item) {
            if (is_array($item)) {
                $result = array_merge($result, $this->flatter($item));
            } else {
                $result[] = $item;
            }
        }

        return $result;
    }
public function flatter($array)
    {
        $result = [];
        foreach ($array as $item) {
            if (is_array($item)) {
                $result = array_merge($result, $this->flatter($item));
            } else {
                $result[] = $item;
            }
        }

        return $result;
    }
public function flatter ( $ array ) { $ result = [ ] ; foreach ( $ array as $ item ) { if ( is_array ( $ item ) ) { $ result = array_merge ( $ result , $ this -> flatter ( $ item ) ) ; } else { $ result [ ] = $ item ; } } return $ result ; }
Flatter function.

@param array $array

@return array
Flatter function .