fileperms
獲取文件權限
fileperms()
函數返回文件或目錄的權限。
若成功,則返回文件的訪問權限。若失敗,則返回false。
<?php echo fileperms ( "test.txt" ) ; ?>
輸出:
33206
以八進制值返回權限:
<?php echo substr ( sprintf ( "%o" , fileperms ( "test.txt" ) ) , - 4 ) ; ?>
輸出:
1777
fileperms ( filename )
參數 | 描述 |
---|---|
filename | 必需。規定要檢查的文件。 |