Current Location: Home> Function Categories> chown

chown

Change file owner
Name:chown
Category:File system
Programming Language:php
One-line Description:Change the file owner.

Definition and usage

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

Return TRUE if successful, otherwise return FALSE.

Example

 <?php
chown ( "test.txt" , "charles" )
?>

grammar

 chown ( file , owner )
parameter describe
file Required. Specify documents to be inspected.
owner Specify new owners. It can be the username or the user's ID.

illustrate

Try changing the owner of the file file to user owner (specified by username or user ID). Only the superuser can change the owner of the file.