I would like to get all files that has '_img' and PDF type in a folder
Instead of using
$fileArray = scandir($dir);
foreach ($fileArray as $file) {
if (preg_match("_img",$file) && pathinfo($file, PATHINFO_EXTENSION) == 'pdf'){
$filteredArray[] = $file;
}
}
Are there any short cut or it is the best way? Thanks