uTools-Manuals/docs/php/posix_getgrnam.html
2019-04-08 23:22:26 +08:00

157 lines
5.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Return info about a group by name</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.posix-getgrnam" class="refentry">
<div class="refnamediv">
<h1 class="refname">posix_getgrnam</h1>
<p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">posix_getgrnam</span> &mdash; <span class="dc-title">Return info about a group by name</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.posix-getgrnam-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>posix_getgrnam</strong></span>
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
) : <span class="type">array</span></div>
<p class="para rdfs-comment">
Gets information about a group provided its name.
</p>
</div>
<div class="refsect1 parameters" id="refsect1-function.posix-getgrnam-parameters">
<h3 class="title">参数</h3>
<p class="para">
<dl>
<dt>
<code class="parameter">name</code></dt>
<dd>
<p class="para">The name of the group</p>
</dd>
</dl>
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.posix-getgrnam-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
Returns an <span class="type"><a href="language.types.array.html" class="type array">array</a></span> on success, 或者在失败时返回 <strong><code>FALSE</code></strong>.
The array elements returned are:
<table class="doctable table">
<caption><strong>The group information array</strong></caption>
<thead>
<tr>
<th>Element</th>
<th>Description</th>
</tr>
</thead>
<tbody class="tbody">
<tr>
<td>name</td>
<td>
The name element contains the name of the group. This is
a short, usually less than 16 character &quot;handle&quot; of the
group, not the real, full name. This should be the same as
the <code class="parameter">name</code> parameter used when
calling the function, and hence redundant.
</td>
</tr>
<tr>
<td>passwd</td>
<td>
The passwd element contains the group&#039;s password in an
encrypted format. Often, for example on a system employing
&quot;shadow&quot; passwords, an asterisk is returned instead.
</td>
</tr>
<tr>
<td>gid</td>
<td>
Group ID of the group in numeric form.
</td>
</tr>
<tr>
<td>members</td>
<td>
This consists of an <span class="type"><a href="language.types.array.html" class="type array">array</a></span> of
<span class="type"><a href="language.types.string.html" class="type string">string</a></span>&#039;s for all the members in the group.
</td>
</tr>
</tbody>
</table>
</p>
</div>
<div class="refsect1 examples" id="refsect1-function.posix-getgrnam-examples">
<h3 class="title">范例</h3>
<p class="para">
<div class="example" id="example-4339">
<p><strong>Example #1 Example use of <span class="function"><strong>posix_getgrnam()</strong></span></strong></p>
<div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$groupinfo&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">posix_getgrnam</span><span style="color: #007700">(</span><span style="color: #DD0000">"toons"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$groupinfo</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
</div>
<div class="example-contents"><p>以上例程的输出类似于:</p></div>
<div class="example-contents screen">
<div class="cdata"><pre>
Array
(
[name] =&gt; toons
[passwd] =&gt; x
[members] =&gt; Array
(
[0] =&gt; tom
[1] =&gt; jerry
)
[gid] =&gt; 42
)
</pre></div>
</div>
</div>
</p>
</div>
<div class="refsect1 seealso" id="refsect1-function.posix-getgrnam-seealso">
<h3 class="title">参见</h3>
<p class="para">
<ul class="simplelist">
<li class="member"><span class="function"><a href="posix_getegid.html" class="function" rel="rdfs-seeAlso">posix_getegid()</a> - Return the effective group ID of the current process</span></li>
<li class="member"><span class="function"><a href="posix_getgrgid.html" class="function" rel="rdfs-seeAlso">posix_getgrgid()</a> - Return info about a group by group id</span></li>
<li class="member"><span class="function"><a href="filegroup.html" class="function" rel="rdfs-seeAlso">filegroup()</a> - 取得文件的组</span></li>
<li class="member"><span class="function"><a href="stat.html" class="function" rel="rdfs-seeAlso">stat()</a> - 给出文件的信息</span></li>
<li class="member"><a href="ini.sect.safe-mode.html#ini.safe-mode-gid" class="link">safe_mode_gid</a></li>
<li class="member">POSIX man page GETGRNAM(3)</li>
</ul>
</p>
</div>
</div></div></div></body></html>