遍历文件夹下所有文件-PHP源码
php代码:
function foreachDir($path){
$handle=opendir($path);
if($handle){
while (false !== ($file = readdir($handle))) {
if($file!="." && $file!='..'){
if(is_dir($path.$file)){
echo $path.$file."
";
foreachDir($path.$file);
}else{
echo "--".$path."/".$file."
";
}
}
}
return false;
}
}
/phpyy/43285.htmlwww.phpzy.comtrue/phpyy/43285.htmlTechArticle遍历文件夹下所有文件-PHP源码 php代码: function foreachDir($path){$handle=opendir($path);if($handle){while (false !== ($file = readdir($handle))) {if($file!="." $file!=..){if(is_dir($path.$file)){echo $path.$file." "; foreach...
PHP之友评论