PHP » I/O » chown()

Syntax:
bool chown(string filename, mixed user)
filename
The name of the file.
user
The new owner. Either the numerical UID or the name of the user.

Changes the owner of a file.

This function changes the owner of a file. The owner specified can either be in numerical form or the name of the user. TRUE is returned on success. If an error occurs, FALSE is returned.

Examples

Code:
<?php

if (chown("file.txt", "root")) {
   print "File owner changed";
}

?>
Output:
File owner changed.
Explanation:

The owner of a file is changed.

See Also: