PHP chgrp() function

Definition and Usage

The chgrp() function changes the group of the file.

Returns TRUE if successful, otherwise returns 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

Attempt to change the file file Change the group to belong to group (Specified by group name or group ID).

Only super users can modify the file group arbitrarily, other users may only change the file group to the group they belong to.

Example

<?php
chgrp("test.txt","admin")
?>