<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.gettext.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.bindtextdomain.php',
    1 => 'bindtextdomain',
    2 => 'Sets or gets the path for a domain',
  ),
  'up' => 
  array (
    0 => 'ref.gettext.php',
    1 => 'Gettext 函数',
  ),
  'prev' => 
  array (
    0 => 'function.bind-textdomain-codeset.php',
    1 => 'bind_textdomain_codeset',
  ),
  'next' => 
  array (
    0 => 'function.dcgettext.php',
    1 => 'dcgettext',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/gettext/functions/bindtextdomain.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.bindtextdomain" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">bindtextdomain</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">bindtextdomain</span> &mdash; <span class="dc-title">Sets or gets the path for a domain</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.bindtextdomain-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>bindtextdomain</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$domain</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$directory</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   The <span class="function"><strong>bindtextdomain()</strong></span> function sets or gets the path
   for a domain.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.bindtextdomain-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">domain</code></dt>
     <dd>
      <p class="para">
       The domain.
      </p>
     </dd>
    
    
     <dt><code class="parameter">directory</code></dt>
     <dd>
      <p class="para">
       The directory path.
       An empty string means the current directory.
       If <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>, the currently set directory is returned.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.bindtextdomain-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   The full pathname for the <code class="parameter">domain</code> currently being set,
    或者在失败时返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.bindtextdomain-changelog">
  <h3 class="title">更新日志</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>版本</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.4.0</td>
      <td>
       <code class="parameter">directory</code> is optional now.
       Previously, the parameter always had to be specified.
      </td>
     </tr>

     <tr>
      <td>8.0.3</td>
      <td>
       <code class="parameter">directory</code> is nullable now.
       Previously, it was not possible to retrieve the currently set directory.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.bindtextdomain-examples">
  <h3 class="title">示例</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>示例 #1 <span class="function"><strong>bindtextdomain()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$domain </span><span style="color: #007700">= </span><span style="color: #DD0000">'myapp'</span><span style="color: #007700">;<br />echo </span><span style="color: #0000BB">bindtextdomain</span><span style="color: #007700">(</span><span style="color: #0000BB">$domain</span><span style="color: #007700">, </span><span style="color: #DD0000">'/usr/share/myapp/locale'</span><span style="color: #007700">);<br /><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">/usr/share/myapp/locale</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.bindtextdomain-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <p class="para">
    The <span class="function"><strong>bindtextdomain()</strong></span> information is maintained per process,
    not per thread.
   </p>
  </p></blockquote>
 </div>

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