Return all values from an $array as a sequential array (without it's keys)

@param array $array
@param bool $flatten

@return array
197863
public static function values(array $array, bool $flatten = false): array
    {
        if (!$flatten) {
            return \array_values($array);
        }

        $res = [];

        \array_walk_recursive($array, function ($val) use (&$res) {
            $res[] = $val;
        });

        return $res;
    }
1353034
public static function recursiveMerge(...$arrays)
    {
        $merged = array ();
        foreach($arrays as $array)
        {
            if (!is_array($array))
            {
                continue;
            }
            foreach ( $array as $key => $value )
            {
                if (is_string ( $key ))
                {
                    if (is_array ( $value ) && isset($merged[$key]) && is_array ( $merged [$key] ))
                    {
                        $merged [$key] = static::recursiveMerge ( $merged [$key], $value );
                    }
                    else
                    {
                        $merged [$key] = $value;
                    }
                }
                else
                {
                    $merged [] = $value;
                }
            }
        }
        return $merged;
    }
782431
public static function flatten($arr) {
		if(!is_array($arr))
			return [$arr];
		$res = [];
		foreach($arr as $k=>$v) {
			if(is_array($v))
				$res = array_merge($res, static::flatten($v));
			else
				$res[] = $v;
		}
		return $res;
	}
803902
public static function deepMergePropertiesArray($arrays)
    {
        $result = array();

        foreach ($arrays as $array) {
            foreach ($array as $key => $value) {
                // Renumber integer keys as array_merge_recursive() does. Note that PHP
                // automatically converts array keys that are integer strings (e.g., '1')
                // to integers.
                if (is_integer($key)) {
                    $result[] = $value;
                } // Recurse when both values are arrays.
                elseif (isset($result [$key]) && is_array($result [$key]) && is_array($value)) {
                    $result[$key] = self::deepMergePropertiesArray(array($result [$key], $value));
                } // Otherwise, use the latter value, overriding any previous value.
                else {
                    $result[$key] = $value;
                }
            }
        }

        return $result;
    }
215686
protected function _flattenMultiDimensionalParams($arrays, $prefix = null)
    {
        $new = array();

        if (is_object($arrays)) {
            $arrays = get_object_vars($arrays);
        }

        foreach ($arrays as $key => $value) {
            $k =
                isset($prefix) ?
                    $prefix . '[' . $key . ']' :
                    $key;

            if (is_array($value) || is_object($value)) {
                $new =
                    array_merge(
                        $new,
                        $this->_flattenMultiDimensionalParams($value, $k)
                    );
            } else {
                $new[$k] = $value;
            }
        }

        return $new;
    }
260471
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;
    }
534859
public static function lists($array, $key)
    {
        $result = [];
        foreach ($array as $element) {
            $value = static::get($element, $key);
            $result[$value] = $element;
        }

        return $result;
    }
1326310
public static function flatten(array $array, string $separator = null, string $prepend = ''): array
    {
        $flattened = [];

        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $flattened = array_merge($flattened, static::flatten($value, $separator, $prepend . $key . $separator));
            } else {
                $flattened[$prepend . $key] = $value;
            }
        }

        return $flattened;
    }
176962
public function nestArray($prefix, $array)
    {
        $data = [];
        foreach($array as $key => $value) {
            array_set($data, $prefix.$key, $value);
        }
        return $data;
    }
836015
public static function flatten(array $arr)
    {
        $flat = [];
        foreach ($arr as $v) {
            if (is_array($v)) {
                $flat = array_merge($flat, self::flatten($v));
            } else {
                $flat[] = $v;
            }
        }
        return $flat;
    }
936601
public static function flatten($array, $glue = ':', $reset = true, $indexed = true)
    {
        static $return = array();
        static $curr_key = array();

        if ($reset) {
            $return = array();
            $curr_key = array();
        }

        foreach ($array as $key => $val) {
            $curr_key[] = $key;
            if (is_array($val) and ($indexed or array_values($val) !== $val)) {
                static::flatten_assoc($val, $glue, false);
            } else {
                $return[implode($glue, $curr_key)] = $val;
            }
            array_pop($curr_key);
        }
        return $return;
    }
596005
public static function flatten(array $array)
    {
        $result = array();

        array_walk_recursive($array, function ($value, $key) use (& $result) {
            if (is_numeric($key) or is_object($value)) {
                $result[] = $value;
            } else {
                $result[$key] = $value;
            }
        });

        return $result;
    }
832560
public static function getValues($array)
    {
        settype($array, 'array');
        $values = array();
        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $values = array_merge($values, self::getValues($value));
            } else {
                $values[] = $value;
            }
        }

        return $values;
    }
337076
public static function array_flatten(array $array){
		$index = 0;
		$count = count($array);

		while ($index < $count) {
			if (is_array($array[$index])) {
				array_splice($array, $index, 1, $array[$index]);
			} else {
				++$index;
			}
			$count = count($array);
		}
		return $array;
	}
739435
public static function formatResponseArray(array $array): array
    {
        $formattedArray = [];

        foreach ($array as $item) {
            reset($item);
            $formattedArray[key($item)] = current($item);
        }

        return $formattedArray;
    }
477588
public function recursiveConvertInArray($array)
    {
        $newArray = [];
        foreach ($array as $key => $value) {
            if ($value instanceof \MongoDB\Model\BSONDocument || $value instanceof \MongoDB\Model\BSONArray) {
                $value = (array) $value;
            }

            if (is_array($value)) {
                $value = $this->recursiveConvertInArray($value);
            }

            $newArray[$key] = $value;
        }

        return $newArray;
    }
1235366
public static function flatten($array)
    {
        if (!is_array($array)) {
            // nothing to do if it's not an array
            return array($array);
        }

        $result = array();
        foreach ($array as $value) {
            // explode the sub-array, and add the parts
            $result = array_merge($result, static::flatten($value));
        }

        return $result;
    }