php 遍歷目錄下的所有文件

function list_file($path='/Public/Api/img/swiper'){
	$arr=[];
	$temp=\scandir('.'.$path);
	foreach($temp as $v){
		$file=$path.'/'.$v;
		if($v=='.'||$v=='..'||\is_dir($file))continue;
		$arr[]='https://'.$_SERVER[HTTP_HOST].$file;
	}
	return $arr;
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章