/**
* 获取指定目录下的所有文件
* @param null $path
* @return array
*/
public function getFileByPath($path = null)
{
$dirs = new FilesystemIterator($path);
$arr = [];
foreach ($dirs as $v)
{
if($v->isdir())
{
$_arr = $this->getFileByPath($path ."/". $v->getFilename());
$arr = array_merge($arr,$_arr);
}else{
$arr[] = $path . "/" . $v->getFilename();
}
}
return $arr;
}
转载自:https://blog.csdn.net/qq_34629975/article/details/82800318