Arr.php
public static function delimit(array $array, string $prepend = '', string $delimiter = null)
    {
        // Results holder.
        $results = [];

        // Which string delimiter should we use?
        if (null === $delimiter) {
            $delimiter = static::$delimiter;
        }

        foreach ($array as $key => $value) {
            if (is_array($value) && !empty($value)) {
                $results = array_merge($results, static::delimit($value, $prepend.$key.$delimiter));
            } else {
                $results[$prepend.$key] = $value;
            }
        }

        return $results;
    }
public static function delimit(array $array, string $prepend = '', string $delimiter = null)
    {
        // Results holder.
        $results = [];

        // Which string delimiter should we use?
        if (null === $delimiter) {
            $delimiter = static::$delimiter;
        }

        foreach ($array as $key => $value) {
            if (is_array($value) && !empty($value)) {
                $results = array_merge($results, static::delimit($value, $prepend.$key.$delimiter));
            } else {
                $results[$prepend.$key] = $value;
            }
        }

        return $results;
    }
public static function delimit ( array $ array , string $ prepend = '' , string $ delimiter = null ) { // Results holder. $ results = [ ] ; // Which string delimiter should we use? if ( null === $ delimiter ) { $ delimiter = static :: $ delimiter ; } foreach ( $ array as $ key => $ value ) { if ( is_array ( $ value ) && ! empty ( $ value ) ) { $ results = array_merge ( $ results , static :: delimit ( $ value , $ prepend . $ key . $ delimiter ) ) ; } else { $ results [ $ prepend . $ key ] = $ value ; } } return $ results ; }
Flattens a multi-dimensional array using the given delimiter.

@param   array   $array      The initial array.
@param   string  $prepend    A string that should be prepended to the keys.
@param   string  $delimiter  The delimiter to use when exploding the key into parts.
@return  array               The resulting array.
Flattens a multi - dimensional array using the given delimiter .