$file = "/home/user/test.txt"; echo "Group ID of ".$file." is: " . filegroup($file);
$dir = "/home/user/test"; echo "Group ID of ".$dir." is: " . filegroup($dir);In the above example, the filegroup() function is used to get the group ID of the test directory. Package Library: The getGroupId function is a built-in function in PHP and does not require any external package or library.