title: Bad word check in PHP using stripos
body: <p>I implemented this "bad word" check function in php:</p>
  
  <pre><code># bad word detector
  function check_badwords($string) {
      $badwords = array(a number of words some may find inappropriate for SE);
      foreach($badwords as $item) {
          if(stripos($string, $item) !== false) return true;
      }
      return false;
  }
  </code></pre>
  
  <p>It works alright, except I'm having a little problem. If the $string is:</p>
  
  <pre><code>Who is the best guitarist ever?
  </code></pre>
  
  <p>...it returns true, because there is a match with <strong>Who</strong> ($string) and <strong>ho</strong> (in $badwords array). How could the function be modified so that it only checks for complete words, and not just <em>part of words</em>?</p>
  
  <ul>
  <li>check_badwords('She is a ho'); //should return true</li>
  <li>check_badwords('Who is she?'); //should return false</li>
  </ul>
  
  <p>Thanks!</p>