更改 "test.txt" 文件的权限:
<?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);
?>
chmod() 函数更改指定文件的权限。
chmod(
file,
mode)
Parameter | Description |
---|---|
file | Required. Specifies the path to the file |
mode | Required. Specifies the new permissions. The mode parameter consists of four numbers:
Possible values (to set multiple permissions, add up the following numbers):
|
返回值: | TRUE 成功,FALSE 失败 |
---|---|
PHP 版本: | 4.0+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!