First off, I do not want what is in the URL query. I want what PHP see's in the$_GET
array.
This is because the URL query will not show all the params if mod_rewrite
has been used to make pretty URLs
So is there a way to get the query string that would match exactly what is in the php $_GET
array?
--
I came up with a way myself using PHP and JavaScript like so:
function query_string()
{
<?php
function assoc_array_to_string ($arr)
{
$a = array();
foreach($arr as $key => $value)
{
$str = $key.'='.$value;
$a[] = $str;
}
return implode("&",$a);
}
?>
return '<?=urlencode(assoc_array_to_string($_GET))?>';
}
...but I need to do this with just javascript if possible because I can't put PHP code in a .js
file.