title: What is the best way to remove punctuation marks, symbols, diacritics, special characters?
body: <p>I use these lines of code to remove all punctuation marks, symbols, etc as you can see them in the array,</p>
  
  <pre><code>$pattern_page = array("+",",",".","-","'","\"","&amp;","!","?",":",";","#","~","=","/","$","£","^","(",")","_","&lt;","&gt;");
  
  $pg_url = str_replace($pattern_page, ' ', strtolower($pg_url));
  </code></pre>
  
  <p>but I want to make it simpler as it looks silly to list all the stuff I want to remove in the array as there might be some other special characters I want to remove.</p>
  
  <p>I thought of using the regular expression below,</p>
  
  <pre><code>$pg_url = preg_replace("/\W+/", " ", $pg_url);
  </code></pre>
  
  <p>but it doesn't remove under-score - <code>_</code></p>
  
  <p>What is the best way to remove all these stuff? Can regular expression do that?</p>