public static function expand(array $array, string $prepend = ''): array
    {
        $results = [];

        if ($prepend) {
            $prepend .= '.';
        }

        foreach ($array as $key => $value) {
            if ($prepend) {
                $pos = strpos($key, $prepend);

                if ($pos === 0) {
                    $key = substr($key, strlen($prepend));
                }
            }

            $results = static::set($results, $key, $value);
        }

        return $results;
    }
public static function expand(array $array, string $prepend = ''): array
    {
        $results = [];

        if ($prepend) {
            $prepend .= '.';
        }

        foreach ($array as $key => $value) {
            if ($prepend) {
                $pos = strpos($key, $prepend);

                if ($pos === 0) {
                    $key = substr($key, strlen($prepend));
                }
            }

            $results = static::set($results, $key, $value);
        }

        return $results;
    }
public static function expand ( array $ array , string $ prepend = '' ) : array { $ results = [ ] ; if ( $ prepend ) { $ prepend .= '.' ; } foreach ( $ array as $ key => $ value ) { if ( $ prepend ) { $ pos = strpos ( $ key , $ prepend ) ; if ( $ pos === 0 ) { $ key = substr ( $ key , strlen ( $ prepend ) ) ; } } $ results = static :: set ( $ results , $ key , $ value ) ; } return $ results ; }
Expand a flattened array with dots to a multi-dimensional associative array.

@param array  $array
@param string $prepend

@return array
Expand a flattened array with dots to a multi - dimensional associative array .