php-doc-en/reference/posix/functions/posix-getgrgid.xml
Philip Olson ceedc32b00 Initial documentation which includes a 4.2.0+ example, information on behavior
before 4.2.0, and related see also's.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@124657 c90b9560-bf6c-de11-be94-00142212c4b1
2003-04-25 21:44:26 +00:00

89 lines
2.2 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/posix.xml, last change in rev 1.2 -->
<refentry id="function.posix-getgrgid">
<refnamediv>
<refname>posix_getgrgid</refname>
<refpurpose>Return info about a group by group id</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>posix_getgrgid</methodname>
<methodparam><type>int</type><parameter>gid</parameter></methodparam>
</methodsynopsis>
<para>
Returns an <type>array</type> of information about a group and
&false; on failure. If <parameter>gid</parameter> isn't a number
then &null; is returned and an <constant>E_WARNING</constant>
level error is generated.
</para>
<para>
<example>
<title>Example use of <function>posix_getgrgid</function></title>
<programlisting role="php">
<![CDATA[
<?php
$groupid = posix_getegid();
$groupinfo = posix_getgrgid($groupid);
print_r($groupinfo);
/* An example output:
Array
(
[name] => toons
[passwd] => x
[members] => Array
(
[0] => tom
[1] => jerry
)
[gid] => 42
)
*/
?>
]]>
</programlisting>
</example>
</para>
<note>
<para>
As of PHP 4.2.0, members is returned as an array of member
usernames in the group. Before this time it was simply an
integer (the number of members in the group) and the member
names were returned with numerical indices.
</para>
</note>
<para>
See also <function>posix_getegid</function>,
<function>filegroup</function>,
<function>stat</function>, and
<link linkend="ini.safe-mode-gid">safe_mode_gid</link>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->