title: Censor certain words in PHP?
body: <p>I am trying to create an array that include insulting words and when someone tries to submit any of the words that are inside the array, he/she will get an error.</p>
  
  <p>I've tried a couple of time, but failed!</p>
  
  <p>Can anyone help me out please? :)</p>
  
  <pre><code>$censor_ary = array('word1', 'word2', 'word3');
  
      foreach ($censor_ary as $censor)
      {
          $word = $censor;    
      }
  
  if ($_POST['mesazhi'] == $word)
          {
              echo '&lt;span&gt;P&amp;euml;rdorimi i fjal&amp;euml;ve fyese nuk &amp;euml;sht&amp;euml; e mir&amp;euml;seardhur&lt;/span&gt;';
          }
  </code></pre>