Possible Duplicate:
Finding a file with a specific name with any extension
i've this code for put into an array all the files contained into a directory
$directory = "./";
$ourDirList = scandir($directory);
$arraylistafiles=array();
foreach($ourDirList as $ourItem)
{
if (is_file($ourDir . $ourItem))
{$arraylistafiles[]=$ourItem;}
}
but if i want to put only the file that have ".jpg" extension, what i can do?