title: preg_match with external txt file
body: <p>I have a .txt file that holds a lot of forbidden words in a forum, with the expression like:</p>
  
  <p>//filterwords.txt<br> 
  XXX<br>
  YYY<br>
  ZZZ</p>
  
  <p>and then, I would like to use preg_match to check incoming text $str with these words; if those forbidden words are not included, we can do something; otherwise, we do another thing... I am not sure about the expression, and I just know:-</p>
  
  <pre><code>$filter_word = file("filterwords.txt")
  
  for ($i=0; $i&lt; count($filter_word);$i++)
  {
    if(!preg_match($filter_word[$i],$str))
    {
      echo "not ok!";
      exit;
    }
    else
    {
      echo "ok!!";
      exit;
    }
  }
  </code></pre>
  
  <p>Could experts teach me how to write the preg_match part? thankyou.</p>