<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.strings.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.nl-langinfo.php',
    1 => 'nl_langinfo',
    2 => 'Query language and locale information',
  ),
  'up' => 
  array (
    0 => 'ref.strings.php',
    1 => '字符串 函数',
  ),
  'prev' => 
  array (
    0 => 'function.money-format.php',
    1 => 'money_format',
  ),
  'next' => 
  array (
    0 => 'function.nl2br.php',
    1 => 'nl2br',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/strings/functions/nl-langinfo.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.nl-langinfo" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">nl_langinfo</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.1.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">nl_langinfo</span> &mdash; <span class="dc-title">Query language and locale information</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.nl-langinfo-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>nl_langinfo</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$item</code></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">
   <span class="function"><strong>nl_langinfo()</strong></span> is used to access individual elements of
   the locale categories.  Unlike <span class="function"><a href="function.localeconv.php" class="function">localeconv()</a></span>, which
   returns all of the elements, <span class="function"><strong>nl_langinfo()</strong></span> allows you
   to select any specific element.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.nl-langinfo-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">item</code></dt>
     <dd>
      <p class="para">
       <code class="parameter">item</code> may be an integer value of the element or the
       constant name of the element. The following is a list of constant names
       for <code class="parameter">item</code> that may be used and their description.
       Some of these constants may not be defined or hold no value for certain
       locales.
       <table class="doctable table">
        <caption><strong>nl_langinfo Constants</strong></caption>
        
         <col />
         <col />
         <thead>
          <tr>
           <th>Constant</th>
           <th>Description</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td colspan="2" style="text-align: center;"><em><strong><code><a href="string.constants.php#constant.lc-time">LC_TIME</a></code></strong> Category Constants</em></td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.abday-1">ABDAY_<span class="replaceable">(1-7)</span></a></code></strong></td>
           <td>Abbreviated name of n-th day of the week.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.day-1">DAY_<span class="replaceable">(1-7)</span></a></code></strong></td>
           <td>Name of the n-th day of the week (DAY_1 = Sunday).</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.abmon-1">ABMON_<span class="replaceable">(1-12)</span></a></code></strong></td>
           <td>Abbreviated name of the n-th month of the year.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.mon-1">MON_<span class="replaceable">(1-12)</span></a></code></strong></td>
           <td>Name of the n-th month of the year.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.am-str">AM_STR</a></code></strong></td>
           <td>String for Ante meridian.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.pm-str">PM_STR</a></code></strong></td>
           <td>String for Post meridian.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.d-t-fmt">D_T_FMT</a></code></strong></td>
           <td>String that can be used as the format string for <span class="function"><a href="function.strftime.php" class="function">strftime()</a></span> to represent time and date.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.d-fmt">D_FMT</a></code></strong></td>
           <td>String that can be used as the format string for <span class="function"><a href="function.strftime.php" class="function">strftime()</a></span> to represent date.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.t-fmt">T_FMT</a></code></strong></td>
           <td>String that can be used as the format string for <span class="function"><a href="function.strftime.php" class="function">strftime()</a></span> to represent time.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.t-fmt-ampm">T_FMT_AMPM</a></code></strong></td>
           <td>String that can be used as the format string for <span class="function"><a href="function.strftime.php" class="function">strftime()</a></span> to represent time in 12-hour format with ante/post meridian.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.era">ERA</a></code></strong></td>
           <td>Alternate era.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.era-year">ERA_YEAR</a></code></strong></td>
           <td>Year in alternate era format.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.era-d-t-fmt">ERA_D_T_FMT</a></code></strong></td>
           <td>Date and time in alternate era format (string can be used in <span class="function"><a href="function.strftime.php" class="function">strftime()</a></span>).</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.era-d-fmt">ERA_D_FMT</a></code></strong></td>
           <td>Date in alternate era format (string can be used in <span class="function"><a href="function.strftime.php" class="function">strftime()</a></span>).</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.era-t-fmt">ERA_T_FMT</a></code></strong></td>
           <td>Time in alternate era format (string can be used in <span class="function"><a href="function.strftime.php" class="function">strftime()</a></span>).</td>
          </tr>

          <tr>
           <td colspan="2" style="text-align: center;"><em><strong><code><a href="string.constants.php#constant.lc-monetary">LC_MONETARY</a></code></strong> Category Constants</em></td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.int-curr-symbol">INT_CURR_SYMBOL</a></code></strong></td>
           <td>International currency symbol.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.currency-symbol">CURRENCY_SYMBOL</a></code></strong></td>
           <td>Local currency symbol.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.crncystr">CRNCYSTR</a></code></strong></td>
           <td>Same value as <strong><code><a href="string.constants.php#constant.currency-symbol">CURRENCY_SYMBOL</a></code></strong>.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.mon-decimal-point">MON_DECIMAL_POINT</a></code></strong></td>
           <td>Decimal point character.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.mon-thousands-sep">MON_THOUSANDS_SEP</a></code></strong></td>
           <td>Thousands separator (groups of three digits).</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.mon-grouping">MON_GROUPING</a></code></strong></td>
           <td>Like <code class="literal">&quot;grouping&quot;</code> element.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.positive-sign">POSITIVE_SIGN</a></code></strong></td>
           <td>Sign for positive values.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.negative-sign">NEGATIVE_SIGN</a></code></strong></td>
           <td>Sign for negative values.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.int-frac-digits">INT_FRAC_DIGITS</a></code></strong></td>
           <td>International fractional digits.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.frac-digits">FRAC_DIGITS</a></code></strong></td>
           <td>Local fractional digits.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.p-cs-precedes">P_CS_PRECEDES</a></code></strong></td>
           <td>Returns 1 if <strong><code><a href="string.constants.php#constant.currency-symbol">CURRENCY_SYMBOL</a></code></strong> precedes a positive value.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.p-sep-by-space">P_SEP_BY_SPACE</a></code></strong></td>
           <td>Returns 1 if a space separates <strong><code><a href="string.constants.php#constant.currency-symbol">CURRENCY_SYMBOL</a></code></strong> from a positive value.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.n-cs-precedes">N_CS_PRECEDES</a></code></strong></td>
           <td>Returns 1 if <strong><code><a href="string.constants.php#constant.currency-symbol">CURRENCY_SYMBOL</a></code></strong> precedes a negative value.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.n-sep-by-space">N_SEP_BY_SPACE</a></code></strong></td>
           <td>Returns 1 if a space separates <strong><code><a href="string.constants.php#constant.currency-symbol">CURRENCY_SYMBOL</a></code></strong> from a negative value.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.p-sign-posn">P_SIGN_POSN</a></code></strong></td>
           <td rowspan="2" style="vertical-align: middle;">
            <ul class="itemizedlist">
             <li class="listitem">
              <span class="simpara">
                Returns 0 if parentheses surround the quantity and <strong><code><a href="string.constants.php#constant.currency-symbol">CURRENCY_SYMBOL</a></code></strong>.
              </span>
             </li>
             <li class="listitem">
              <span class="simpara">
               Returns 1 if the sign string precedes the quantity and <strong><code><a href="string.constants.php#constant.currency-symbol">CURRENCY_SYMBOL</a></code></strong>.
              </span>
             </li>
             <li class="listitem">
              <span class="simpara">
               Returns 2 if the sign string follows the quantity and <strong><code><a href="string.constants.php#constant.currency-symbol">CURRENCY_SYMBOL</a></code></strong>.
              </span>
             </li>
             <li class="listitem">
              <span class="simpara">
               Returns 3 if the sign string immediately precedes the <strong><code><a href="string.constants.php#constant.currency-symbol">CURRENCY_SYMBOL</a></code></strong>.
              </span>
             </li>
             <li class="listitem">
              <span class="simpara">
               Returns 4 if the sign string immediately follows the <strong><code><a href="string.constants.php#constant.currency-symbol">CURRENCY_SYMBOL</a></code></strong>.
              </span>
             </li>
            </ul>
           </td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.n-sign-posn">N_SIGN_POSN</a></code></strong></td>
          </tr>

          <tr>
           <td colspan="2" style="text-align: center;"><em><strong><code><a href="string.constants.php#constant.lc-numeric">LC_NUMERIC</a></code></strong> Category Constants</em></td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.decimal-point">DECIMAL_POINT</a></code></strong></td>
           <td>Decimal point character.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.radixchar">RADIXCHAR</a></code></strong></td>
           <td>Same value as <strong><code><a href="string.constants.php#constant.decimal-point">DECIMAL_POINT</a></code></strong>.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.thousands-sep">THOUSANDS_SEP</a></code></strong></td>
           <td>Separator character for thousands (groups of three digits).</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.thousep">THOUSEP</a></code></strong></td>
           <td>Same value as <strong><code><a href="string.constants.php#constant.thousands-sep">THOUSANDS_SEP</a></code></strong>.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.grouping">GROUPING</a></code></strong></td>
           <td class="empty">&nbsp;</td>
          </tr>

          <tr>
           <td colspan="2" style="text-align: center;"><em><strong><code><a href="string.constants.php#constant.lc-messages">LC_MESSAGES</a></code></strong> Category Constants</em></td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.yesexpr">YESEXPR</a></code></strong></td>
           <td>Regex string for matching <code class="literal">&quot;yes&quot;</code> input.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.noexpr">NOEXPR</a></code></strong></td>
           <td>Regex string for matching <code class="literal">&quot;no&quot;</code> input.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.yesstr">YESSTR</a></code></strong></td>
           <td>Output string for <code class="literal">&quot;yes&quot;</code>.</td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.nostr">NOSTR</a></code></strong></td>
           <td>Output string for <code class="literal">&quot;no&quot;</code>.</td>
          </tr>

          <tr>
           <td colspan="2" style="text-align: center;"><em><strong><code><a href="string.constants.php#constant.lc-ctype">LC_CTYPE</a></code></strong> Category Constants</em></td>
          </tr>

          <tr>
           <td><strong><code><a href="string.constants.php#constant.codeset">CODESET</a></code></strong></td>
           <td>Return a string with the name of the character encoding.</td>
          </tr>

         </tbody>
        
       </table>

      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.nl-langinfo-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the element as a string, or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> if <code class="parameter">item</code>
   is not valid.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.nl-langinfo-examples">
  <h3 class="title">示例</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>示例 #1 <span class="function"><strong>nl_langinfo()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">nl_langinfo</span><span style="color: #007700">(</span><span style="color: #0000BB">CODESET</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">nl_langinfo</span><span style="color: #007700">(</span><span style="color: #0000BB">YESEXPR</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="annotation-interactive examplescode"><pre class="examplescode">string(14) &quot;ANSI_X3.4-1968&quot;
string(5) &quot;^[yY]&quot;</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.nl-langinfo-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">注意</strong>: <span class="simpara">此函数未在 Windows 平台下实现。</span></p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.nl-langinfo-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.setlocale.php" class="function" rel="rdfs-seeAlso">setlocale()</a> - 设置区域信息</span></li>
    <li><span class="function"><a href="function.localeconv.php" class="function" rel="rdfs-seeAlso">localeconv()</a> - Get numeric formatting information</span></li>
   </ul>
  </p>
 </div>


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