Check in many folders :
Folder_1 and folder_2 are name of folders, from which we have to select files.
$format is required format.
<?php
$arr = array("folder_1","folder_2");
$format = ".csv";
for($x=0;$x<count($arr);$x++){
$mm = $arr[$x];
foreach (glob("$mm/*$format") as $filename) {
echo "$filename size " . filesize($filename) . "<br>";
}
}
?>