PHP - How do I get a parameter value from $_SERVER['HTTP_REFERER']?
<p>In a PHP application, $_SERVER['HTTP_REFERER'] has the following value:  </p>

<pre>
http://www.google.com/aclk?sa=l&ai=CPWNSJV30TK{snip}&num=2&sig=AGiWqtxY{snip}
&adurl=http://www.jumpfly.com&rct=j&q=adwords&cad=rja
</pre>

<p>My question is what is the proper way to extract the value of q?  </p>

<p>Should I search for the position of q, then the position of the next &amp;, and then take the substring between them?  That seems a bit unprofessional since what if someday q is the final parameter in that query string and then there is no &amp; afterwards.</p>

<p>Thank you.</p>
