View Single Post
  #3   IP: 153.99.39.110
Old 2016-08-16, 12:55 AM
Kendall Kendall is offline
初级会员
 
Join Date: 2009-07-07
Posts: 1
Kendall 现在声名狼藉
Default

I would loop through the files and look at their extensions:
Code:
$dir = '/tmp';
$dh  = opendir($dir);
while (false !== ($fileName = readdir($dh))) {
    $ext = substr($fileName, strrpos($fileName, '.') + 1);
    if(in_array($ext, array("jpg","jpeg","png","gif")))
        $files1[] = $fileName;
}
Reply With Quote