Latest web development tutorials

PHP chown () function

PHP Filesystem Reference Manual Complete PHP Filesystem Reference Manual

Definition and Usage

chown () function to change the owner of the specified file.

If successful it returns TRUE, on failure returns FALSE.

grammar

chown(file,owner)

参数 描述
file 必需。规定要检查的文件。
owner 必需。规定新的所有者。可以是用户名或用户的 ID。


Examples

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


PHP Filesystem Reference Manual Complete PHP Filesystem Reference Manual