- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
chgrp()function in PHP
The chgroup() function updates the file group. Remember that only the superuser has the authority to change the group of a file arbitrarily,
Syntax
chgroup($file_path, group)
Parameters
file_path − Set the path of file or directory to be checked. Required.
group − Set the new user group name or number.
Return
The chgroup() function returns.
- True, on success,
- False, on failure
Example
The following is an example that checks for file “one.txt” and changes its file group.
<?php $file_path1 = "/themes/myfiles/one.php"; $file_path2 = "/themes/myfiles/two.php"; // changing groups of two files chgrp($file_path1, "admin"); chgrp($file_path2, "guest"); ?>
Output
TRUE TRUE
Advertisements