一聚教程网:一个值得你收藏的教程网站

热门教程

php chmod 函数教程

时间:2022-07-02 10:00:12 编辑:袖梨 来源:一聚教程网

php chmod定义和用法
chmod属性( )函数的改变指定文件的权限,如果在返回TRUE和FALSE成功的失败。

语法

chmod(file,mode)
file
必需的。指定的档案检查
mode

必需的。指定新的权限。参数的模式由四个数字:一是数量始终为零第二个数字指定的权限的所有者第三若干规定的权限所有者的用户组第四若干规定的权限其他人可能值(设置多个权限,增加下面的编号) :

1 =执行权限

2 =写入权限

4 =读取权限

下面我们来看看实例吧。
// Read and write for owner, nothing for 读写的人,没有为其他
chmod("test.txt",0600);// Read and write for 读写的主人,阅读别人
chmod("test.txt",0644);// Everything for 一切的主人,阅读和执行的其他人
chmod("test.txt",0755);// Everything for 一切为了人,读的所有者的组
chmod("test.txt",0740);
?> 

热门栏目