public static function flattenArray($array, $delimiter = '.', $prefix = '') {
        if(!is_array($array)) {
            return $array;
        }

        $result = array();

        foreach($array as $key => $value) {
            if(is_array($value)) {
                $result = array_merge($result, self::flattenArray($value, $delimiter, $prefix.$key.$delimiter));
            }
            else {
                $result[$prefix.$key] = $value;
            }
        }

        return $result;
    }
public static function flattenArray($array, $delimiter = '.', $prefix = '') {
        if(!is_array($array)) {
            return $array;
        }

        $result = array();

        foreach($array as $key => $value) {
            if(is_array($value)) {
                $result = array_merge($result, self::flattenArray($value, $delimiter, $prefix.$key.$delimiter));
            }
            else {
                $result[$prefix.$key] = $value;
            }
        }

        return $result;
    }
public static function flattenArray ( $ array , $ delimiter = '.' , $ prefix = '' ) { if ( ! is_array ( $ array ) ) { return $ array ; } $ result = array ( ) ; foreach ( $ array as $ key => $ value ) { if ( is_array ( $ value ) ) { $ result = array_merge ( $ result , self :: flattenArray ( $ value , $ delimiter , $ prefix . $ key . $ delimiter ) ) ; } else { $ result [ $ prefix . $ key ] = $ value ; } } return $ result ; }
Flattens an array, preserving keys delimited by a delimiter

@param array $array The array that will be flattened
@param string $delimiter The used delimiter.
@param string $prefix Will be added in front of every key
@return array<mixed> The resulting array
Flattens an array preserving keys delimited by a delimiter