国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

PHP檢查一個目錄下的所有文件的權(quán)限并列表
phpcn_u315
phpcn_u315 2017-02-01 18:53:52
0
3
1136

搜狗截圖20170201185007.png

如上圖中有許多文件。PHP怎么循環(huán)列出liuyanben文件夾里的所有文件的權(quán)限,并依次列出

就像dz安裝時檢查文件權(quán)限的列表似得

改用什么PHP代碼???




phpcn_u315
phpcn_u315

reply all(3)
數(shù)據(jù)分析師

PHP checks the permissions of all files in a directory and lists them - PHP Chinese website Q&A - PHP checks the permissions of all files in a directory and lists them - PHP Chinese website Q&A

Take a look around and learn .

Ty80
<?php
function?stripleft($string,$str){
	$i=stripos($string,$str);
	if($i===0){
		return?substr($string,strlen($str));
	}else{
		return?$string;
	}
}
$files=glob(FCPATH.'*.*');
foreach($files?as?$k=>$f){
$a=stripleft($f,FCPATH);
echo?$a.'?|?'.getChmod($a).'<br>';
}


Ty80
/*
?*?substr?返回字符串的子串
?*?base_convert??在任意進制之間轉(zhuǎn)換數(shù)字
?*?fileperms??取得文件的權(quán)限
?*/
//?獲取權(quán)限
function?getChmod($filepath){
????return?substr(base_convert(@fileperms($filepath),10,8),-4);
}


Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template