Implementation of PHP profanity filter
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/273516/how-do-you-implement-a-good-profanity-filter">How do you implement a good profanity filter?</a>  </p>
</blockquote>



<p>I have an iPhone app that passes a string through a URL to my php script, which then inserts to my database. I'd like to write some php code that reads $body for any pre-defined profanity.</p>

<p>Right now, I only have the following code, but it only looks for exact matches, not if $body contains, then.. type of a sequence. Also, I need it to replace the swear with a blank " ", removing the word all together.</p>

<pre><code>if($body == "swear word") 
    return;
</code></pre>
