title: Stop Words function
body: <p>I have this function that returns true if one of the bad words is found in the array <code>$stopwords</code></p>
  
  <pre><code>function stopWords($string, $stopwords) {
      $stopwords = explode(',', $stopwords);
      $pattern = '/\b(' . implode('|', $stopwords) . ')\b/i';
      if(preg_match($pattern, $string) &gt; 0) {
         return true;
      }
      return false;
  }
  </code></pre>
  
  <p>It seems to work fine.</p>
  
  <p>The problem is that when the array <code>$stopwords</code> is empty ( so no bad words specified ), it always returns true, like if the empty value is recognized as a bad word and it always returns true ( I think the issue it's this but maybe is another one ).</p>
  
  <p>Can anyone help me sorting out this issue?</p>
  
  <p>Thanks</p>