title: Parse a URL to extract all the GET variables in the URL
body: <p>How can I parse the current url to get all the GET variables from it. Although there is a function by the name of </p>
  
  <pre><code>HTTP_GET_VARS
  </code></pre>
  
  <p>But the documentation says it is deprecated so I do not want to use that. I want to do something like this, if I have a url as</p>
  
  <pre><code>www.example.com/variables.php?var1=1&amp;var2=2&amp;var3=3
  </code></pre>
  
  <p>I want to extract all the GET variable in an array vars such that I have the name of the variable as well it's value in the url so tha I can use them while building a different url as </p>
  
  <pre><code>www.example.com/new_variables.php?vars[var_name]=vars[var_value]
  </code></pre>
  
  <p>I can go through all the variables in a for loop and incrementally build the url. What I mean is that using GET I have to see if the value is set for each of the variables that I expecting, but what I want is to get the list of all the GET variables which are set. My ulr can contain 3-4 variable which may not be set all the time. I don't want to check if all 4 are set at any point of time, I just want to filter my query based on whichever parameters are set. </p>