Possible Duplicate:
Parse query string into an array
How can I explode a string such as:
a=1&b=2&c=3
So that it becomes:
Array {
[a] => 1
[b] => 2
[c] => 3
}
Using the regular explode() function delimited on the & will separate the parameters but not in [key] => [value] pairs.
Thanks.
Use PHP’s
parse_strfunction.I wonder where you get this string from? If it’s part of the URL after the question mark (the query string of an URL), you can already access it via the superglobal
$_GETarray: