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


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


Answered By – Filip Roséen – refp

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published