title: How do I write a regex in PHP to remove special characters?
body: <p>I'm pretty new to PHP, and I noticed there are many different ways of handling regular expressions.</p>
  
  <p>This is what I'm currently using:</p>
  
  <pre><code>$replace = array(" ",".",",","'","@");
  $newString = str_replace($replace,"_",$join);
  
  $join = "the original string i'm parsing through";
  </code></pre>
  
  <p>I want to remove everything which isn't a-z, A-Z, or 0-9. I'm looking for a reverse function of the above. A pseudocode way to write it would be </p>
  
  <blockquote>
    <p>If characters in $join are not equal to a-z,A-Z,0-9
    then change characters in <code>$join</code> to <code>"_"</code></p>
  </blockquote>