用PHP实现递归循环每一个目录

时间:2020-12-17 21:56:49
【文件属性】:
文件名称:用PHP实现递归循环每一个目录
文件大小:27KB
文件格式:PDF
更新时间:2020-12-17 21:56:49
循环 递归 函数的原理很简单,主要就是用了一下递归调用。 复制代码 代码如下: function file_list($path){ if ($handle = opendir($path)) { while (false !== ($file = readdir($handle))) { if ($file != “.” && $file != “..”) { if (is_dir($path.”/”.$file)) { echo $path.”: “.$file.”
”;//去掉此行显示的是所有的非目录文件 file_list($path.”/”.$file); } else { echo $p

网友评论