PHP chown() Function
Definition and Usage
The chown() function changes the owner of the specified file.
Returns TRUE if successful, otherwise FALSE.
Syntax
chown(file,owner)
Parameter | Description |
---|---|
file | Required. Specify the file to be checked. |
owner | Define the new owner. It can be a username or user ID. |
Description
Attempt to change the file file Change the owner to user owner (Specified by username or user ID). Only superusers can change the file owner.
Example
<?php chown("test.txt","charles") ?>