PHP fileperms() 函数

PHP 教程 · 2019-01-24 23:44:14

定义和用法

fileperms() 函数返回文件或目录的权限。

如果成功,该函数以数字形式返回权限。如果失败,则返回 FALSE。

语法


fileperms(filename)


参数 描述
filename 必需。规定要检查的文件。

提示和注释

注释:该函数的结果会被缓存。请使用 clearstatcache() 来清除缓存。

实例 1


<?php
echo fileperms("test.txt");
?> 

上面的代码将输出:


33206


实例 2

以八进制值显示权限:


<?php
echo substr(sprintf("%o",fileperms("test.txt")),-4);
?> 

上面的代码将输出:


1777


点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html

查看所有标签

Powerful

Powerful

Patty McCord / Missionday / 2018-1-25

Named by The Washington Post as one of the 11 Leadership Books to Read in 2018 When it comes to recruiting, motivating, and creating great teams, Patty McCord says most companies have it all wrong. Mc......一起来看看 《Powerful》 这本书的介绍吧!

MD5 加密
MD5 加密

MD5 加密工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试