Flatten the input $array

@param $array

@return mixed
491826
private function flattenArray($array)
    {
        $objTmp = (object)['aFlat' => []];

        array_walk_recursive($array, function(&$v, $k, &$t) {
            $t->aFlat[] = $v;
        }, $objTmp);

        return $objTmp->aFlat;
    }
157566
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;
    }
1047886
protected function _convertArrayable(array $array)
    {
        $arr = [];

        foreach ($array as $key => $value) {
            if ($value instanceof ArrayableInterface) {
                $arr[$value instanceof NameableInterface ? $value->getName() : $key] = $value->toArray();
            } elseif (\is_array($value)) {
                $arr[$key] = $this->_convertArrayable($value);
            } else {
                $arr[$key] = $value;
            }
        }

        return $arr;
    }
1250118
public static function flattenAssoc(array $array, $depth = INF) : array
    {
        $result = [];
        $depth = is_int($depth) ? max($depth, 0) : INF;

        foreach ($array as $key => $value) {
            if (is_array($value) && $depth >= 1) {
                $result = self::flattenAssoc($value, $depth - 1) + $result;
            } else {
                $result[$key] = $value;
            }
        }

        return $result;
    }
910332
private function flatten(array $array)
    {
        $single = array();
        if (isset($array['hier'])) {
            unset($array['hier']);
        }
        foreach ($array as $key => $value) {
            if (is_array($value)) {
                foreach ($this->flatten($value) as $key => $value) {
                    $single[$key] = $value;
                }
            } else {
                $single[$key] = $value;
            }
        }

        return $single;
    }
606680
function flatten(array, target) {
	const result = target || [];

	for (let i = 0; i < array.length; ++i) {
		if (Array.isArray(array[i])) {
			flatten(array[i], result);
		}
		else {
			result.push(array[i]);
		}
	}

	return result;
}
539679
public static function flatten($array, $depth = INF)
    {
        $result = [];

        foreach ($array as $item) {
            $item = $item instanceof Collection ? $item->all() : $item;

            if (is_array($item)) {
                if ($depth === 1) {
                    $result = array_merge($result, $item);
                    continue;
                }

                $result = array_merge($result, static::flatten($item, $depth - 1));
                continue;
            }

            $result[] = $item;
        }

        return $result;
    }
834641
public static function flatten($array)
    {
        $isAssoc = self::isAssoc($array);

        $flat = [];
        foreach ($array as $key => $value)
        {
            if (is_array($value))
            {
                $flat = array_merge($flat, self::flatten($value));
            }
            else
            {
                if ($isAssoc)
                {
                    $flat[$key] = $value;
                }
                else
                {
                    $flat[] = $value;
                }
            }
        }

        return $flat;
    }
1370423
public function _transform(array $array = null)
    {
        if (empty($array)) return;


        foreach ($array as $param) {
            if (strpos($param, '=') > 0) {
                $tmp           = explode(Generic::ASSIGNMENT_OPERATOR, $param);
                $this->$tmp[0] = $tmp[1];
            }
        }

        return;
    }
813774
public static function flatten($array, $preserveKeys = true, &$out = array())
    {
        array_walk_recursive(
            $array,
            function ($value, $key) use (&$out, $preserveKeys) {
                if (!is_scalar($value)) {
                    // Do nothing
                } elseif ($preserveKeys) {
                    $out[$key] = $value;
                } else {
                    $out[] = $value;
                }
            }
        );

        return $out;
    }
269632
private function arrayFlatten(array $array)
    {
        $flat = array();
        foreach ($array as $arg) {
            switch (gettype($arg)) {
                case 'array':
                    $flat = array_merge($flat, $arg);
                    break;

                default:
                    $flat[] = $arg;
                    break;
            }
        }

        return $flat;
    }
920431
private function trimArray($array)
    {
        foreach ($array as $key => $value) {
            // Do not attemp to trim array variables, boolean variables, or the proxy password
            // Trimming a boolean value (as a string) may not produce the expected output, so pass it through as-is
            if (!is_array($value) && !is_bool($value) && $key !== 'proxy_password') {
                $array[$key] = trim($value);
            }
        }
        return $array;
    }
1262398
public static function array_copy($array)
    {
        if (!is_array($array)) {
            return $array;
        }

        $result = array();
        foreach ($array as $key => $val) {
            if (is_array($val)) {
                $result[$key] = self::array_copy($val);
            } elseif (is_object($val)) {
                $result[$key] = clone $val;
            } else {
                $result[$key] = $val;
            }
        }
        return $result;
    }
1100568
public static function flatten($array)
    {
        $return = [];

        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $return = \array_merge($return, static::flatten($value));
            } elseif ($value instanceof Collection) {
                $return = \array_merge($return, static::flatten($value->all()));
            } else {
                $return[$key] = $value;
            }
        }

        return $return;
    }
934371
public static function normalizeMap($array)
    {
        $nested = array();

        foreach ((array) $array as $key=>$value) {
            if (is_numeric($key)) {
                $nested[$value] = array();
            } else {
                $nested[$key] = $value;
            }
        }

        return $nested;
    }
326497
protected function arrayToObject(array $array)
    {
        $obj = (object) [];

        foreach ($array as $k => $v) {

            if (strlen($k)) {
                if (is_array($v)) {
                    $obj->{$k} = $this->arrayToObject($v);
                } else {
                    $obj->{$k} = $v;
                }
            }
        }

        return $obj;
    }
467192
public static function arrayToList(array $array = array())
    {
        $return = array();
        foreach ($array as $name => $email) {
            $return[] = empty($name) || General::intval($name) > -1
                        ? $email
                        : $name . ' <' . $email . '>';
        }

        return implode(', ', $return);
    }