PHP » I/O » chgrp()

Syntax:
bool chgrp(string filename, mixed group)
filename
The name of the file.
group
Group, in the form of a number or a name.

Changes the group of a file.

This function changes the group of a file. The group specified can either be in numerical form or the name of the user. TRUE is returned on success. If an error occurs, FALSE is returned.

Examples

Code:
<?php

if (chgrp("file.txt", "root")) {
   print "File group changed";
}

?>
Output:
File group changed
Explanation:

The group of a file is changed.

See Also: