PHP封装一个遍历文件夹下面得所有的文件的类
//遍历文件夹下面所有的文件
function my_scandir($dir)
{
$files = array();
if ($handle = opendir($dir)){
while (($files = readdir($handle)) !== false){
if ($files != "." && $files != "."){
$files[$files] = my_scandir($dir . "/" . $files);
} else {
$files[] = $files;
}
}
}
closedir($handle);
return $files;
}
文章标题:PHP封装一个遍历文件夹下面得所有的文件的类
文章源于:http://www.scyingshan.cn/article/jcoisj.html


咨询
建站咨询
