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.
Element | Description |
---|---|
name | The 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. |
passwd | The 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. |
members | This consists of an array of string's for all the members in the group. |
gid | Group 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 )
Links
Related
POSIX
- posix_access
- posix_ctermid
- posix_eaccess
- posix_errno
- posix_fpathconf
- posix_get_last_error
- posix_getcwd
- posix_getegid
- posix_geteuid
- posix_getgid
- posix_getgrnam
- posix_getgroups
- posix_getlogin
- posix_getpgid
- posix_getpgrp
- posix_getpid
- posix_getppid
- posix_getpwnam
- posix_getpwuid
- posix_getrlimit
- posix_getsid
- posix_getuid
- posix_initgroups
- posix_isatty
- posix_kill
- posix_mkfifo
- posix_mknod
- posix_pathconf
- posix_setegid
- posix_seteuid
- posix_setgid
- posix_setpgid
- posix_setrlimit
- posix_setsid
- posix_setuid
- posix_strerror
- posix_sysconf
- posix_times
- posix_ttyname
- posix_uname