PHP chown() Function

❮ PHP Filesystem Reference

Example

Change owner for the "test.txt" file:

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


Definition and Usage

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

Syntax

chown(file, owner)

Parameter Values

Parameter Description
file Required. Specifies the path to the file to change owner for
owner Required. Specifies the new owner. Can be a user name or a user ID.


Technical Details

Return Value: TRUE on success, FALSE on failure
PHP Version: 4.0+

❮ PHP Filesystem Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.