In PHP, the chown() function can set the owner of the specified file. If successful, it returns TRUE, otherwise it returns FALSE; the syntax format is "chown(file,owner)", the parameter file specifies the file, and the parameter owner Specify new owner.
The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
chown() is in PHP A built-in function that sets the owner of a specified file. The syntax format is as follows:
chown(file,owner)
Parameters | Description |
---|---|
file | Required. Specifies the documents to be checked. |
owner | Required. Provide new owner. Can be a username or the user's ID. |
Note: Only the superuser can change the owner of the file
Return value: TRUE if successful, otherwise FALSE.
Example:
<?php chown("test.txt","charles") ?>
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What is the php function chown used to set?. For more information, please follow other related articles on the PHP Chinese website!