mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-28 20:35:50 +08:00
354 lines
13 KiB
HTML
354 lines
13 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>Query language and locale information</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.nl-langinfo" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">nl_langinfo</h1>
|
|
<p class="verinfo">(PHP 4 >= 4.1.0, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">nl_langinfo</span> — <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">int</span> <code class="parameter">$item</code></span>
|
|
) : <span class="type">string</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="localeconv.html" 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 class="emphasis">LC_TIME Category Constants</em></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>ABDAY_(1-7)</code></strong></td>
|
|
<td>Abbreviated name of n-th day of the week.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>DAY_(1-7)</code></strong></td>
|
|
<td>Name of the n-th day of the week (DAY_1 = Sunday).</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>ABMON_(1-12)</code></strong></td>
|
|
<td>Abbreviated name of the n-th month of the year.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>MON_(1-12)</code></strong></td>
|
|
<td>Name of the n-th month of the year.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>AM_STR</code></strong></td>
|
|
<td>String for Ante meridian.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>PM_STR</code></strong></td>
|
|
<td>String for Post meridian.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>D_T_FMT</code></strong></td>
|
|
<td>String that can be used as the format string for <span class="function"><a href="strftime.html" class="function">strftime()</a></span> to represent time and date.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>D_FMT</code></strong></td>
|
|
<td>String that can be used as the format string for <span class="function"><a href="strftime.html" class="function">strftime()</a></span> to represent date.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>T_FMT</code></strong></td>
|
|
<td>String that can be used as the format string for <span class="function"><a href="strftime.html" class="function">strftime()</a></span> to represent time.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>T_FMT_AMPM</code></strong></td>
|
|
<td>String that can be used as the format string for <span class="function"><a href="strftime.html" class="function">strftime()</a></span> to represent time in 12-hour format with ante/post meridian.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>ERA</code></strong></td>
|
|
<td>Alternate era.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>ERA_YEAR</code></strong></td>
|
|
<td>Year in alternate era format.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>ERA_D_T_FMT</code></strong></td>
|
|
<td>Date and time in alternate era format (string can be used in <span class="function"><a href="strftime.html" class="function">strftime()</a></span>).</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>ERA_D_FMT</code></strong></td>
|
|
<td>Date in alternate era format (string can be used in <span class="function"><a href="strftime.html" class="function">strftime()</a></span>).</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>ERA_T_FMT</code></strong></td>
|
|
<td>Time in alternate era format (string can be used in <span class="function"><a href="strftime.html" class="function">strftime()</a></span>).</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td colspan="2" style="text-align: center;"><em class="emphasis">LC_MONETARY Category Constants</em></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>INT_CURR_SYMBOL</code></strong></td>
|
|
<td>International currency symbol.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>CURRENCY_SYMBOL</code></strong></td>
|
|
<td>Local currency symbol.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>CRNCYSTR</code></strong></td>
|
|
<td>Same value as <strong><code>CURRENCY_SYMBOL</code></strong>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>MON_DECIMAL_POINT</code></strong></td>
|
|
<td>Decimal point character.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>MON_THOUSANDS_SEP</code></strong></td>
|
|
<td>Thousands separator (groups of three digits).</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>MON_GROUPING</code></strong></td>
|
|
<td>Like <em>"grouping"</em> element.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>POSITIVE_SIGN</code></strong></td>
|
|
<td>Sign for positive values.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>NEGATIVE_SIGN</code></strong></td>
|
|
<td>Sign for negative values.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>INT_FRAC_DIGITS</code></strong></td>
|
|
<td>International fractional digits.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>FRAC_DIGITS</code></strong></td>
|
|
<td>Local fractional digits.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>P_CS_PRECEDES</code></strong></td>
|
|
<td>Returns 1 if <strong><code>CURRENCY_SYMBOL</code></strong> precedes a positive value.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>P_SEP_BY_SPACE</code></strong></td>
|
|
<td>Returns 1 if a space separates <strong><code>CURRENCY_SYMBOL</code></strong> from a positive value.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>N_CS_PRECEDES</code></strong></td>
|
|
<td>Returns 1 if <strong><code>CURRENCY_SYMBOL</code></strong> precedes a negative value.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>N_SEP_BY_SPACE</code></strong></td>
|
|
<td>Returns 1 if a space separates <strong><code>CURRENCY_SYMBOL</code></strong> from a negative value.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>P_SIGN_POSN</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>CURRENCY_SYMBOL</code></strong>.
|
|
</span>
|
|
</li>
|
|
<li class="listitem">
|
|
<span class="simpara">
|
|
Returns 1 if the sign string precedes the quantity and <strong><code>CURRENCY_SYMBOL</code></strong>.
|
|
</span>
|
|
</li>
|
|
<li class="listitem">
|
|
<span class="simpara">
|
|
Returns 2 if the sign string follows the quantity and <strong><code>CURRENCY_SYMBOL</code></strong>.
|
|
</span>
|
|
</li>
|
|
<li class="listitem">
|
|
<span class="simpara">
|
|
Returns 3 if the sign string immediately precedes the <strong><code>CURRENCY_SYMBOL</code></strong>.
|
|
</span>
|
|
</li>
|
|
<li class="listitem">
|
|
<span class="simpara">
|
|
Returns 4 if the sign string immediately follows the <strong><code>CURRENCY_SYMBOL</code></strong>.
|
|
</span>
|
|
</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>N_SIGN_POSN</code></strong></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td colspan="2" style="text-align: center;"><em class="emphasis">LC_NUMERIC Category Constants</em></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>DECIMAL_POINT</code></strong></td>
|
|
<td>Decimal point character.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>RADIXCHAR</code></strong></td>
|
|
<td>Same value as <strong><code>DECIMAL_POINT</code></strong>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>THOUSANDS_SEP</code></strong></td>
|
|
<td>Separator character for thousands (groups of three digits).</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>THOUSEP</code></strong></td>
|
|
<td>Same value as <strong><code>THOUSANDS_SEP</code></strong>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>GROUPING</code></strong></td>
|
|
<td class="empty"> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td colspan="2" style="text-align: center;"><em class="emphasis">LC_MESSAGES Category Constants</em></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>YESEXPR</code></strong></td>
|
|
<td>Regex string for matching <em>"yes"</em> input.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>NOEXPR</code></strong></td>
|
|
<td>Regex string for matching <em>"no"</em> input.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>YESSTR</code></strong></td>
|
|
<td>Output string for <em>"yes"</em>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>NOSTR</code></strong></td>
|
|
<td>Output string for <em>"no"</em>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td colspan="2" style="text-align: center;"><em class="emphasis">LC_CTYPE Category Constants</em></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><strong><code>CODESET</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>FALSE</code></strong> if <code class="parameter">item</code>
|
|
is not valid.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 notes" id="refsect1-function.nl-langinfo-notes">
|
|
<h3 class="title">注释</h3>
|
|
<blockquote class="note"><p><strong class="note">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 class="member"><span class="function"><a href="setlocale.html" class="function" rel="rdfs-seeAlso">setlocale()</a> - 设置地区信息</span></li>
|
|
<li class="member"><span class="function"><a href="localeconv.html" class="function" rel="rdfs-seeAlso">localeconv()</a> - Get numeric formatting information</span></li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
</div></div></div></body></html> |