title: Filter array of filenames against an array of banned words and an array of banned file extensions
body: <p>I am using PHP and I have an array of user images that I need to filter. I need to do 2 different filters:</p>
  <ol>
  <li>Look in original array and see if each value contains a value in my &quot;bad words&quot; array</li>
  <li>Look and see if the value in the original array ends in one of &quot;bad extensions&quot; values</li>
  </ol>
  <p>Images Array:</p>
  <pre><code>Array  
  (  
      [0] =&gt; smiles.gif  
      [1] =&gt; kittens.jpg  
      [2] =&gt; biscuits.png  
      [3] =&gt; butthead.jpg  
  )  
  
  $bad_words = array('beavis','butthead','winehouse');  
  $bad_extensions = array('.gif','.tiff');  
  </code></pre>
  <p>I would like it to return:</p>
  <pre><code>Array  
  (  
      [0] =&gt; kittens.jpg  
      [1] =&gt; biscuits.png  
  )
  </code></pre>