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