Set the owner of the file “test.txt”.
<?php chown(“test.txt”,“charles”) ?> |
The chown() function modifies the owner of the specified file.
chown(file, owner) |
Parameter |
Description |
file |
Mandatory. Specifies the path to the file for which the owner is to be changed. |
owner |
Mandatory. Specifies the new owner, which can be either a username or a user ID. |
Return Value: |
TRUE on success, FALSE on failure |
PHP Version: |
4.0+ |