function.posix-getgrnam.html

来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 204 行

HTML
204
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Return info about a group by name</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.posix-getgrgid.html">posix_getgrgid</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.posix-getgroups.html">posix_getgroups</a></div> <div class="up"><a href="ref.posix.html">POSIX Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.posix-getgrnam" class="refentry"> <div class="refnamediv">  <h1 class="refname">posix_getgrnam</h1>  <p class="verinfo">(PHP 4, PHP 5)</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">  <h3 class="title">Description</h3>  <div class="methodsynopsis dc-description">   <span class="type">array</span> <span class="methodname"><b><b>posix_getgrnam</b></b></span>    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$name</tt></span>   )</div>  <p class="para rdfs-comment">   Gets information about a group provided its name.   </p> </div> <div class="refsect1 parameters">  <h3 class="title">Parameters</h3>  <p class="para">   <dl>    <dt>     <span class="term"><i><tt class="parameter">name</tt></i></span>     <dd>      <p class="para">The name of the group</p>     </dd>    </dt>   </dl>  </p> </div> <div class="refsect1 returnvalues">  <h3 class="title">Return Values</h3>  <p class="para">   The array elements returned are:   <table border="5">    <caption><b>The group information array</b></caption>    <colgroup>     <thead valign="middle">      <tr valign="middle">       <th colspan="1">Element</th>       <th colspan="1">Description</th>      </tr>     </thead>     <tbody valign="middle" class="tbody">      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">name</td>       <td colspan="1" rowspan="1" align="left">        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 <i><tt class="parameter">name</tt></i> parameter used when        calling the function, and hence redundant.       </td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">passwd</td>       <td colspan="1" rowspan="1" align="left">        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 valign="middle">       <td colspan="1" rowspan="1" align="left">gid</td>       <td colspan="1" rowspan="1" align="left">        Group ID of the group in numeric form.       </td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">members</td>       <td colspan="1" rowspan="1" align="left">        This consists of an <a href="language.types.array.html" class="type array">array</a> of        <a href="language.types.string.html" class="type string">string</a>&#039;s for all the members in the group.       </td>      </tr>     </tbody>    </colgroup>   </table>  </p> </div> <div class="refsect1 changelog">  <h3 class="title">ChangeLog</h3>  <p class="para">   <table class="informaltable">    <colgroup>     <thead valign="middle">      <tr valign="middle">       <th colspan="1">Version</th>       <th colspan="1">Description</th>      </tr>     </thead>     <tbody valign="middle" class="tbody">      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">4.2.0</td>       <td colspan="1" rowspan="1" align="left">        Prior to this version, members was simply an integer representing the        number of members in the group, and the member names were returned        with numerical indices.       </td>      </tr>     </tbody>    </colgroup>   </table>  </p> </div> <div class="refsect1 examples">  <h3 class="title">Examples</h3>  <p class="para">   <div class="example">    <p><b>Example #1 Example use of <b>posix_getgrnam()</b></b></p>    <div class="example-contents"><div class="phpcode"><code><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></code></div>    </div>    <div class="example-contents"><p>The above example will output something similar to:</p></div>    <div class="example-contents"><pre><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>    </pre></div>   </div>  </p> </div> <div class="refsect1 seealso">  <h3 class="title">See Also</h3>  <p class="para">   <ul class="simplelist">    <li class="member"><a href="function.posix-getegid.html" class="function" rel="rdfs-seeAlso">posix_getegid()</a></li>    <li class="member"><a href="function.posix-getgrgid.html" class="function" rel="rdfs-seeAlso">posix_getgrgid()</a></li>    <li class="member"><a href="function.filegroup.html" class="function" rel="rdfs-seeAlso">filegroup()</a></li>    <li class="member"><a href="function.stat.html" class="function" rel="rdfs-seeAlso">stat()</a></li>    <li class="member"><a href="features.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><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.posix-getgrgid.html">posix_getgrgid</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.posix-getgroups.html">posix_getgroups</a></div> <div class="up"><a href="ref.posix.html">POSIX Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?