public function getDir($path,$array=[]){
if(!file_exists($path)) {
return [];
}
$files = scandir($path);
$fileItem = [];
foreach($files as $v) {
$newPath = $path .DIRECTORY_SEPARATOR . $v;
if(is_dir($newPath) && $v != '.' && $v != '..') {
array_push($array, $newPath);
$array = array_merge($array, $this->getDir($newPath));
}
}
return $array;
}
六:总结
- 如果