title: Recursive File Search (PHP)
body: <p>I'm trying to return the files in a specified directory using a recursive search.
  I successfully achieved this, however I want to add a few lines of code that will allow me to specify certain extensions that I want to be returned.</p>
  
  <p>For example return only .jpg files in the directory.</p>
  
  <p>Here's my code,</p>
  
  <pre><code>&lt;?php
  $it = new RecursiveDirectoryIterator("L:\folder\folder\folder");
  foreach(new RecursiveIteratorIterator($it) as $file) {
  echo $file . "&lt;br/&gt; \n";
  }
  ?&gt;
  </code></pre>
  
  <p>please let me know what I can add to the above code to achieve this, thanks</p>