Retrieve the list of alla jpg file of a directory
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3202203/finding-a-file-with-a-specific-name-with-any-extension">Finding a file with a specific name with any extension</a>  </p>
</blockquote>



<p>i've this code for put into an array all the files contained into a directory</p>

<pre><code>$directory =  "./";
$ourDirList = scandir($directory); 
$arraylistafiles=array();

foreach($ourDirList as $ourItem) 
{  
   if (is_file($ourDir . $ourItem)) 
   {$arraylistafiles[]=$ourItem;}
}  
</code></pre>

<p>but if i want to put only the file that have ".jpg" extension, what i can do? </p>
