How about just using decode thats what the function was made for. $variable = urldecode($_SERVER['QUERY_STRING']); and the do whatever with $variable.
Why don't we just use this (i said at post #11) print urldecode($_SERVER['QUERY_STRING']); PHP: it returns lol there for yourfile.php?lol there
Just wanted to let all of you know that I've tried every suggestion, here are my results: print($_GET[v]); Code (markup): This reproduces almost all text, except "#", where it stops reproducing text. Also, it adds a slash for words like "it's" Ex: file.php?v=adrian peterson's # is 28 This will show "adrian peterson\'s", nothing further, the "#" cuts it off. <? foreach ($_GET as $key=>$value) { echo $key; } ?> This adds an underscore instead of spaces. The replacement text: <? foreach ($_GET as $key=>$value) { echo str_replace("_"," ",$key); } ?> Removes all spaces, a string like page.php?hey there is reproduced as "heythere" Code (markup): print urldecode($_SERVER['QUERY_STRING']); This is the best alternative so far, it's short which makes it easier to implement. It's only draw back is it stops reproducing text at the "#" symbol. I think that's the one I'll use from now on Code (markup): Thank all of you for your help, +rep all around!
the # symbol is a special character in urls as it is used for anchor urls (i.e. to link to a specific point within a web page) You will need to be exceptionally careful if you are going to want to use # in urls for anything other than this purpose. glad the other code snippets helped though