note 47248 deleted from function.unset by googleguy
| From: | googleguy@php.net | Date: | Wed, 16 Jan 2013 05:37:12 +0000 |
| Subject: | note 47248 deleted from function.unset by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-193104@lists.php.net to get a copy of this message | ||
Note Submitter: mv at brasil dot com
----
If you want to remove one element of Query String use this function, than place the returned values
in <a href="script.php?'. remove_query("arg1") .'">
function remove_query($key) {
$arrquery = explode("&", $_SERVER["QUERY_STRING"]);
foreach ($arrquery as $query_value) {
$valor = substr($query_value, strpos($query_value, "=") + 1);
$chave = substr($query_value, 0, strpos($query_value, "="));
$querystring[$chave] = $valor;
}
unset($querystring[$key]);
foreach ($querystring as $query_key => $query_value) {
$query[] = "{$query_key}={$query_value}";
}
$query = implode("&", $query);
return $query;
}