PHP chgrp() Function
Definition and Usage
The chgrp() function changes the group of the file.
Returns TRUE on success, otherwise returns FALSE.
Syntax
chgrp(file,group)
Parameter | Description |
---|---|
file | Required. Specifies the file to be checked. |
group | Optional. Specifies a new group. It can be a group name or the ID of the group. |
Description
try to change the file file change the group of group (Specified by group name or group ID).
Only super users can modify the file group arbitrarily, other users may only be able to change the file group to the group they belong to.
Example
<?php chgrp("test.txt","admin") ?>