function listFiles($dir)
{
$files = array();
$handle = opendir($dir);
while ($file = readdir($handle)) {
if ($file != '.' && $file != '..') {
if (is_dir($dir.'/'.$file)) {
$files[$file] = $this->listFiles($dir.'/'.$file);
} else {
$files[] = $file;
}
}
}
closedir($handle);
return $files;
}
php遍历文件夹所有文件
猜你喜欢
转载自blog.csdn.net/weixin_41111189/article/details/82855765
今日推荐
周排行