PHP chgrp() Function
Definition
The chgrp() function changes the usergroup of the specified file.
Syntax
PHP chgrp() Function has the following syntax.
chgrp(file,group)
Parameter
Parameter | Is Required | Description |
---|---|---|
file | Required. | File to check |
group | Required. | New group. Can be a group name or a group ID |
Return
Returns TRUE on success and FALSE on failure.
Example
<?php// w w w .j ava2 s .c o m
chgrp("test.txt","admin");
$filename = 'my_file.txt';
printf(filegroup($filename));
chgrp($filename, 8);
print "\n";
clearstatcache(); // do not cache filegroup() results
printf(filegroup($filename));
?>