Definition :
The chmod() function in PHP is an inbuilt function which is used to change the mode of a specified file to a specific mode given by the user.
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):
|
Example of chmod() Function: