note 89692 deleted from reserved.variables.get by peehaa
| From: | peehaa@php.net | Date: | Sun, 28 Apr 2019 10:57:52 +0000 |
| Subject: | note 89692 deleted from reserved.variables.get by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-210841@lists.php.net to get a copy of this message | ||
Note Submitter: slavik0329
----
the addget function below actually has more use when you dont use the recursive merge as such:
<?php
function AddGet($ArrayOrString){
if(is_array($ArrayOrString))
return http_build_query(array_merge($GLOBALS['_GET'], $ArrayOrString));
parse_str($ArrayOrString, $output);
return http_build_query(array_merge($GLOBALS['_GET'], $output));
}
?>
In this case, if the key is added again with a different value it will be replaced with the new
value.
addget("change=true"); // ?change=true
addget("change=false"); // ?change=false