Home  >  Article  >  Backend Development  >  What is the php function chown used to set?

What is the php function chown used to set?

青灯夜游
青灯夜游Original
2021-07-07 18:52:351899browse

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.

What is the php function chown used to set?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn