Definition and Usage
定义和用法
The chmod() function changes permissions of the specified file.
chmod()函数的作用是:改变指定文件的模式。
Returns TRUE on success and FALSE on failure.
函数执行成功返回True,执行失败返回False。
Syntax
语法
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):
|
Example
案例
<?php// Read and write for owner, nothing for everybody elsechmod("test.txt","0600"); // Read and write for owner, read for everybody elsechmod("test.txt","0644"); // Everything for owner, read and execute for everybody elsechmod("test.txt","0755"); // Everything for owner, read for owner's groupchmod("test.txt","0740");?> |