检查文件权限

检查文件权限

问题描述:

如何查看file permissions,而不必通过passthru()exec()运行特定于操作系统的命令?

How can I check file permissions, without having to run operating system specific command via passthru() or exec()?

使用 fileperms()函数

clearstatcache();
echo substr(sprintf('%o', fileperms('/etc/passwd')), -4);