English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP Filesystem Reference Manual
The chown() function can change the owner of the specified file.
bool chown ( string filename, mixed user )
Attempt to change the owner of the file filename to the user user (specified by username or user ID). Only superusers can change the owner of the file. This function returns true on success, otherwise false.
<?php // File name and user name to be used $file_name= "index.php"; $path = ""/PhpProject/backup: " . $file_name ; $user_name = "root"; //Set User chown($path, $user_name); print_r($path); ?>
/PhpProject/backup: index.php