<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.posix.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'function.posix-getpwnam.php',
    1 => 'posix_getpwnam',
    2 => '指定した名前のユーザーに関する情報を返す',
  ),
  'up' => 
  array (
    0 => 'ref.posix.php',
    1 => 'POSIX 関数',
  ),
  'prev' => 
  array (
    0 => 'function.posix-getppid.php',
    1 => 'posix_getppid',
  ),
  'next' => 
  array (
    0 => 'function.posix-getpwuid.php',
    1 => 'posix_getpwuid',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/posix/functions/posix-getpwnam.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.posix-getpwnam" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">posix_getpwnam</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">posix_getpwnam</span> &mdash; <span class="dc-title">指定した名前のユーザーに関する情報を返す</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.posix-getpwnam-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>posix_getpwnam</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$username</code></span>): <span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   指定したユーザーに関する情報を配列で返します。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.posix-getpwnam-parameters">
  <h3 class="title">パラメータ</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">username</code></dt>
     <dd>
      <p class="para">
       英数字で表したユーザー名。
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.posix-getpwnam-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   成功した場合は次の要素を持つ配列、それ以外の場合は
   <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> を返します。
   <table class="doctable table">
    <caption><strong>ユーザー情報配列</strong></caption>
    
     <thead>
      <tr>
       <th>要素</th>
       <th>説明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>name</td>
       <td>
        要素 name はユーザー名を有しています。これは、通常、
        実際の完全な名前ではなく16文字未満のユーザーの&quot;ハンドル名&quot;となります。
        この値はこの関数をコールした際に使用したパラメータ
        <code class="parameter">username</code>と同じとする必要があり、
        このため冗長な定義となります。
       </td>
      </tr>

      <tr>
       <td>passwd</td>
       <td>
        要素passwd には暗号化されたユーザーのパスワードが含まれます。
        シャドウパスワードを使用しているシステムでは、アスタリスクが代わりに
        返されます。
       </td>
      </tr>

      <tr>
       <td>uid</td>
       <td>
        数値形式で表したユーザー ID。
       </td>
      </tr>

      <tr>
       <td>gid</td>
       <td>
        ユーザーのグループ ID。
        実際のグループ名を調べたりそのグループのメンバーの一覧を
        得るには関数 <span class="function"><a href="function.posix-getgrgid.php" class="function">posix_getgrgid()</a></span> を使用してください。
       </td>
      </tr>

      <tr>
       <td>gecos</td>
       <td>
        GECOS は旧式の項であり、Honeywell バッチ処理プログラムの
        finger 情報フィールドを参照します。
        しかし、このフィールドはまだ生きており、その内容はPOSIXで
        規定されています。
        このフィールドには、カンマで区切られた
        ユーザーのフルネーム、オフィスの電話番号、家の電話番号に関する
        リストが含まれています。多くのシステムでは、ユーザーのフルネーム
        のみが利用可能です。
       </td>
      </tr>

      <tr>
       <td>dir</td>
       <td>
        この要素には、ユーザーのホームディレクトリへの絶対パスが含まれています。
       </td>
      </tr>

      <tr>
       <td>shell</td>
       <td>
        shell 要素には、ユーザーのデフォルトシェルの実行ファイルへの絶対パスが
        含まれています。
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.posix-getpwnam-examples">
  <h3 class="title">例</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>例1 <span class="function"><strong>posix_getpwnam()</strong></span> の使用例</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$userinfo </span><span style="color: #007700">= </span><span style="color: #0000BB">posix_getpwnam</span><span style="color: #007700">(</span><span style="color: #DD0000">"tom"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$userinfo</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>上の例の出力は、
たとえば以下のようになります。</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Array
(
    [name]    =&gt; tom
    [passwd]  =&gt; x
    [uid]     =&gt; 10000
    [gid]     =&gt; 42
    [gecos]   =&gt; &quot;tom,,,&quot;
    [dir]     =&gt; &quot;/home/tom&quot;
    [shell]   =&gt; &quot;/bin/bash&quot;
)</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.posix-getpwnam-seealso">
  <h3 class="title">参考</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.posix-getpwuid.php" class="function" rel="rdfs-seeAlso">posix_getpwuid()</a> - 指定 ID のユーザーに関する情報を返す</span></li>
    <li>POSIX man ページ GETPWNAM(3)</li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>