/**

* 获取指定目录下的所有文件

* @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 

相关文章:

  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-02
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案