Check a string for bad words?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8801486/efficient-way-to-test-string-for-certain-words">Efficient way to test string for certain words</a>  </p>
</blockquote>



<p>I want to check if a string contains any of these words: <em>ban, bad, user, pass, stack, name, html</em>.</p>

<p>If it contains any of the words I need to echo the number of bad words</p>

<pre><code>str = 'Hello my name is user';
</code></pre>
