1
2
3
4
5
6
7
8
$files = scandir("XXX");
$jpgcont = 0;
foreach($files as $file){
if(preg_match("/.jpg$/", $file)){
echo $file;
}
}
echo $jpgcont;