<?php
function getAllFiles($path){
foreach(scandir($path) as $file){
if($file === '.'|| $file === '..') continue;
if(is_dir($path.'/'.$file)) getAllFiles($path.'/'.$file);
else echo $path.'/'.$file."\n";
}
}
getAllFiles('/Users/sam/test');
?>
转载于:https://my.oschina.net/u/1264926/blog/402306