title: Filter everything but number
body: <p>I have a get url input which I need to pass it into databse, but before doing that since I know that the user id would always be an integer number, I wanted to filter out everything but number in php. The follwoing code is what I came up with, does anyone know a better way than this? or is this the right way?    </p>
  
  <pre><code>$id = preg_replace('#[^0-9]#i', '', $_GET['id']);
  </code></pre>