src/Utility/Utility.php
public static function arrayFlatten($array, $preserveKeys = false) {
		if ($preserveKeys) {
			return static::_arrayFlatten($array);
		}
		if (!$array) {
			return [];
		}
		$result = [];
		foreach ($array as $key => $value) {
			if (is_array($value)) {
				$result = array_merge($result, static::arrayFlatten($value));
			} else {
				$result[$key] = $value;
			}
		}
		return $result;
	}
public static function arrayFlatten($array, $preserveKeys = false) {
		if ($preserveKeys) {
			return static::_arrayFlatten($array);
		}
		if (!$array) {
			return [];
		}
		$result = [];
		foreach ($array as $key => $value) {
			if (is_array($value)) {
				$result = array_merge($result, static::arrayFlatten($value));
			} else {
				$result[$key] = $value;
			}
		}
		return $result;
	}
public static function arrayFlatten ( $ array , $ preserveKeys = false ) { if ( $ preserveKeys ) { return static :: _arrayFlatten ( $ array ) ; } if ( ! $ array ) { return [ ] ; } $ result = [ ] ; foreach ( $ array as $ key => $ value ) { if ( is_array ( $ value ) ) { $ result = array_merge ( $ result , static :: arrayFlatten ( $ value ) ) ; } else { $ result [ $ key ] = $ value ; } } return $ result ; }
Force-flattens an array.

Careful with this method. It can lose information.
The keys will not be changed, thus possibly overwrite each other.

//TODO: check if it can be replace by Hash::flatten() or Utility::flatten().

@param array $array Array to flatten
@param bool $preserveKeys
@return array
Force - flattens an array .