Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

filegroup

Description

The filegroup of Filesystem for PHP gets file group.

Syntax

filegroup(
    string $filename
): int|false

Parameters

filename

Path to the file.

Return

Returns the group ID of the file, or false if an error occurs. The group ID is returned in numerical format, use posix_getgrgid() to resolve it to a group name. Upon failure, false is returned.

Examples

1 · filename

<?

$filename = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/1.txt';

$return = filegroup($filename);

print_r($return);

?>
1234567

2 · posix_getgrgid

<?

$filename = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/1.txt';

$return = filegroup($filename);

$posix_getgrgid = posix_getgrgid($return);

print_r($posix_getgrgid);

?>
Array
(
    [name] => root
    [passwd] => x
    [members] => Array
        (
        )

    [gid] => 1234567
)
HomeMenu