Modify the permissions for the file “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); ?> |
The chmod() function adjusts the permissions of the specified file.
chmod(file, mode) |
Parameter |
Description |
file |
Mandatory. Specifies the path to the file. |
mode |
Mandatory. Specifies the new permissions. The mode parameter is composed of four digits:
Possible values (combine numbers to set multiple permissions):
|
Return Value: |
Returns |
PHP Version: |
4.0+ |