当前位置: 首页 > 网络学院 > 服务端脚本教程 > PHP > chmod() 函数
The chmod() function changes permissions of the specified file.
chmod()函数的作用是:改变指定文件的模式。
Returns TRUE on success and FALSE on failure.
函数执行成功返回True,执行失败返回False。
chmod(file,mode) |
Parameter 参数 | Description 描述 |
---|---|
file | Required. Specifies the file to check 必要参数。指定文件对象 |
mode | Required. Specifies the new permissions. 必要参数。指定新的特许[permission]: The mode parameter consists of four numbers: Mode[模式]参数有四个数字组成:
Possible values (to set multiple permissions, add up the following numbers):
|
<?php // Read and write for owner, nothing for everybody else chmod("test.txt","0600"); // Read and write for owner, read for everybody else chmod("test.txt","0644"); // Everything for owner, read and execute for everybody else chmod("test.txt","0755"); // Everything for owner, read for owner's group chmod("test.txt","0740"); ?> |