标签:php递归遍历目录
其实很简单,就写了一个函数,没啥好说的直接上代码了
public function openDirectory($path)
{
$dir = dir($path);
while (false != ($entry = $dir->read())) {
if ($entry != "." && $entry != "..") {
if (is_dir($path . DIRECTORY_SEPARATOR . $entry)) {
$this->openDirectory($path . DIRECTORY_SEPARATOR . $entry);
} else {
//这里做文件的操作
}
}
}
}标签:php递归遍历目录
原文地址:http://xtceetg.blog.51cto.com/5086648/1874982