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 the user's ID. |
Description
Attempt to change the owner of the file file Change the owner to user owner (Specified by username or user ID). Only superusers can change the owner of the file.
Example
<?php chown("test.txt","charles") ?>