title: php get all url variables
body: <p>I'm trying to make links to include the current _GET variables.</p>
  
  <p>Example link: <code>&lt;a href="?page=2"&gt;Page 2&lt;/a&gt;</code></p>
  
  <p>The current url is: <a href="http://example.com/test.php?id=2&amp;a=1" rel="nofollow">http://example.com/test.php?id=2&amp;a=1</a></p>
  
  <p>So if someone clicks on the link of page 2 it will take them to:
  <a href="http://example.com/test.php?id=2&amp;a=1&amp;page=2" rel="nofollow">http://example.com/test.php?id=2&amp;a=1&amp;page=2</a></p>
  
  <p>Currently if they click on the link it takes them to:
  <a href="http://example.com/test.php?page=2" rel="nofollow">http://example.com/test.php?page=2</a></p>
  
  <p>As you can see, I need a way to get the current _GET variables in the url and add them to the link. Advice?</p>