Php – Get URL query string parameters


What is the "less code needed" way to get parameters from a URL query string which is formatted like the following?

Output should be: myqueryhash

I am aware of this approach:

   echo $_GET['q'];  //Output: myquery

Best Solution

$_SERVER['QUERY_STRING'] contains the data that you are looking for.