title: Remove all bad words (swearwords) from user input string?
body: <p>I was trying to take out swear words from a string and thought I had it done, until someone on this site showed me this: <a href="http://codepad.org/LMuhFH4g" rel="nofollow">http://codepad.org/LMuhFH4g</a></p>
  
  <p>So, is there any way I can go over a string until its clean of all swear words.</p>
  
  <pre><code>$a = array( 'duck', 'chit', 'dsshole' ); 
  
  $str = 'duchitck-you-dssduckhole'; 
  
  $newString = str_ireplace($a,'',$str); 
  $newString = str_ireplace('-','',$newString); 
  $newString = trim($newString); 
  echo $newString;  
  </code></pre>