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

posix_getgrgid

Description

The posix_getgrgid of POSIX for PHP returns information about a group by group id.

Syntax

posix_getgrgid(
    int $group_id
): array|false

Parameters

group_id

The group id.

Return

Returns an array of elements on success, or false on failure.

ElementDescription
nameThe name element contains the name of the group. This is a short, usually less than 16 character "handle" of the group, not the real, full name.
passwdThe passwd element contains the group's password in an encrypted format. Often, for example on a system employing "shadow" passwords, an asterisk is returned instead.
membersThis consists of an array of string's for all the members in the group.
gidGroup ID of the group in numeric form. This should be the same as the group_id parameter used when calling the function, and hence redundant.

Examples

1 · group_id

<?

$group_id = posix_getegid();

$return = posix_getgrgid($group_id);

print_r($return);
Array
(
    [name]    => toons
    [passwd]  => x
    [members] => Array
        (
            [0] => tom
            [1] => jerry
        )
    [gid]     => 42
)