note 69703 deleted from function.http-build-query by bobby
| From: | bobby@php.net | Date: | Wed, 18 Oct 2006 21:59:12 +0000 |
| Subject: | note 69703 deleted from function.http-build-query by bobby | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-118709@lists.php.net to get a copy of this message | ||
Note Submitter:
----
Just in case you'd like to do the opposite of what the function does, use something like this:
function parseQueryString($queryString)
{
for ( $i = 0, $query = array(); $i < sizeof($pcs= explode('&', $queryString));
$i++ )
{
if ( strstr($pcs[$i], '=') )
{
$query[urldecode(substr($pcs[$i], 0, strpos($pcs[$i], '=')))] =
urldecode(substr($pcs[$i], strpos($pcs[$i], '=') + 1));
}
else
{
$query[urldecode($pcs[$i])] = null;
}
}
return $query;
}
This extracts parameters from a query string into an associative array.