src/Util.php
public static function parseQueryString(string $input, bool $encode = false,
        string $ignoredKeys = null): array
    {
        $ret = [];

        if ($input == '') {
            return $ret;
        }

        // hex keys
        $hexed = false;
        if (strpos($input, '.')) {
            $hexed = true;

            // normalize arrays
            if (strpos($input, '%5D')) {
                $input = str_replace(['%5B', '%5D'], ['[', ']'], $input);
            }

            $input = preg_replace_callback('~(^|(?<=&))[^=&\[]+~', function($match) {
                return bin2hex($match[0]);
            }, $input);
        }

        // preserve pluses, so parse_str() will replace all with spaces
        if ($encode) {
            $input = str_replace('+', '%2B', $input);
        }

        parse_str($input, $input);

        // unhex keys
        if ($hexed) {
            foreach ($input as $key => $value) {
                $ret[hex2bin((string) $key)] = $value;
            }
        } else {
            $ret = $input;
        }

        if ($ignoredKeys != '') {
            $ignoredKeys = explode(',', $ignoredKeys);
            foreach ($ret as $key => $_) {
                if (in_array($key, $ignoredKeys)) {
                    unset($ret[$key]);
                }
            }
        }

        return $ret;
    }
public static function parseQueryString(string $input, bool $encode = false,
        string $ignoredKeys = null): array
    {
        $ret = [];

        if ($input == '') {
            return $ret;
        }

        // hex keys
        $hexed = false;
        if (strpos($input, '.')) {
            $hexed = true;

            // normalize arrays
            if (strpos($input, '%5D')) {
                $input = str_replace(['%5B', '%5D'], ['[', ']'], $input);
            }

            $input = preg_replace_callback('~(^|(?<=&))[^=&\[]+~', function($match) {
                return bin2hex($match[0]);
            }, $input);
        }

        // preserve pluses, so parse_str() will replace all with spaces
        if ($encode) {
            $input = str_replace('+', '%2B', $input);
        }

        parse_str($input, $input);

        // unhex keys
        if ($hexed) {
            foreach ($input as $key => $value) {
                $ret[hex2bin((string) $key)] = $value;
            }
        } else {
            $ret = $input;
        }

        if ($ignoredKeys != '') {
            $ignoredKeys = explode(',', $ignoredKeys);
            foreach ($ret as $key => $_) {
                if (in_array($key, $ignoredKeys)) {
                    unset($ret[$key]);
                }
            }
        }

        return $ret;
    }
Parse query string (without changing dotted param keys).
@param  string      $input
@param  bool        $encode
@param  string|null $ignoredKeys
@return array
@link   https://github.com/php/php-src/blob/master/main/php_variables.c#L99