title: Remove all non-alphanumeric characters using preg_replace
body: <p>How can I remove all non alphanumeric characters from a string in PHP?</p>
  
  <p>This is the code, that I'm currently using:</p>
  
  <pre><code>$url = preg_replace('/\s+/', '', $string);
  </code></pre>
  
  <p>It only replaces blank spaces.</p>