public function parseQueryString($query_string)
Parses a query string into a dictionary, applying PHP rules for handling array nomenclature (like a[]=1) in parameter names.
For a more basic parse, see parseQueryStringToPairList().
| string | $query_string | Query string. |
| map<string, wild> | Parsed dictionary. |
public function parseQueryStringToPairList($query_string)
Parses a query string into a basic list of pairs, without handling any array information in the keys. For example:
a[]=1&a[]=2
...will parse into:
array(
array('a[]', '1'),
array('a[]', '2'),
);Use parseQueryString() to produce a more sophisticated parse which applies array rules and returns a dictionary.
| string | $query_string | Query string. |
| list<pair<string, string>> | List of parsed parameters. |
private function parseQueryKeyToArr($key, $val, &$input_arr)
Treats the key as a flat query that potentially has square brackets. If there are square brackets we parse them into an array.
Example input: $key = "email[0]"; $val = "my@example.com";
Example output: array("email" => array(0 => "my@example.com"));
| string | $key | $key |
| string | $val | $val |
| array | &$input_arr | $input_arr |
| wild |