PHP chown() Function

Change owner for the "test.txt" file

Definition and Usage

The chown() function changes the owner of the specified file.

Syntax

chown(file, owner)

Parameter Values

Parameter Description
file Required. Specifies the path to the file to change owner for
owner Required. Specifies the new owner. Can be a user name or a user ID.

Technical Details

Return Value: TRUE on success, FALSE on failure
PHP Version: 4.0+

❮ PHP Filesystem Reference