What is the php function chown used to set?

青灯夜游
Release: 2023-03-11 10:34:01
Original
2037 people have browsed it

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)
Copy after login
ParametersDescription
file Required. Specifies the documents to be checked.
ownerRequired. 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")
?>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template