Phpchmod function tutorial. Phpchmod defines and uses the chmod attribute () function to change the permissions of a specified file. if TRUE or FALSE is returned, the operation fails. Phpchmod definition and usage chmod attribute () function changes php chmod definition and usage chmod attribute () function changes the permission of the specified file, if the return of TRUE or FALSE fails.
Php chmod definition and usage
The chmod attribute () function changes the permission of the specified file. if TRUE or FALSE is returned, the operation fails.
Syntax
chmod(file,mode)
file |
Required. Specified file check |
| Mode |
Required. Specify new permissions. The parameter mode consists of four numbers: first, the number of permissions is always zero. Second, the number of permissions specified by the owner. third, the number of user groups specified by the permission owner. fourth, the number of permissions specified by the permission owner. others can be assigned (set multiple permissions and add the following number):
1 = execution permission
2 = write permission
4 = read permission |
Let's take a look at the instance.
// Read and write for owner, who reads and writes nothing for, is not the owner of other chmod ("test.txt", 0600); // Read and write for Read/write, Read by others
Chmod ("test.txt", 0644); // Everything for all Masters, read and execute others
Chmod ("test.txt", 0755); // Everything for everyone, read the owner's group
chmod("test.txt",0740);?>
The http://www.bkjia.com/PHPjc/445507.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/445507.htmlTechArticlephp chmod defines and uses the chmod attribute () function to change the permissions of the specified file if success fails when TRUE and FALSE are returned. Changes to the chmod attribute () function in php definition and usage...