Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

chown()

Example

Set the owner of the file “test.txt”.

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

Definition and Usage

The chown() function modifies the owner of the specified file.

Syntax

chown(fileowner)

Parameter Values

Parameter

Description

file

Mandatory. Specifies the path to the file for which the owner is to be changed.

owner

Mandatory. Specifies the new owner, which can be either a username or a user ID.

Technical Details

 

Return Value:

TRUE on success, FALSE on failure

PHP Version:

4.0+