What characters should be allowed in a URL and How do I make sure / get rid of unwanted characters?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4223980/the-ultimate-clean-secure-function">The ultimate clean/secure function</a>  </p>
</blockquote>



<p>I am looking for some solution to make sure my $_GET incoming data only has what is needed and not some other dangerous characters, etc. How would be the best validation/sanitization of doing this? I assume REGEXP, could play some role here:</p>

<pre><code>if (isset($_GET['p'])) {
 //validate //sanitize etc...

//call controller... or whatever.
}
</code></pre>
