Convert postvars to querystring
September 25th, 2006 by SubZane
A handy function that converts all variables in the $_POST array into a querystring. Useable if you wish to return to the form from which you posted and have access to all the submited values.
PHP:
-
function postvarsToQueryString($postvars) {
-
$querystring='';
-
for ($i=0;$i<count($values); $i++) {
-
$querystring .= '&'.$keys[$i].'='.$values[$i];
-
}
-
return $querystring;
-
}
-
-
$querystring = postvarsToQueryString($_POST);