Set the user group to “admin” for the file “test.txt”.
| <?php chgrp(“test.txt”,“admin”) ?>  | 
The chgrp() function changes the group ownership of the specified file.
| chgrp(file, group) | 
| 
 Parameter  | 
 Description  | 
| 
 file  | 
 Mandatory. Indicates the path to the file for which the user group is to be changed.  | 
| 
 group  | 
 Mandatory. Specifies the new group name or ID.  | 
| 
 Return Value:  | 
 Returns TRUE on success and FALSE on failure.  | 
| 
 PHP Version:  | 
 4.0+  |