How to check whether any variable is passed through URL or not?
<p>I want to pass a variable (<code>foo=bar</code>) to URL.<br>
If the URL has already a variable, then <code>foo</code> should be appended to current URL with <code>&amp;</code> and <code>foo=bar</code>.<br>
But if the address bar does not have any variable, then the current URL should be appended with <code>?</code> and <code>foo=bar</code></p>

<p>So how can I check whether any variable is present in current URL or not?</p>
