1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332
|
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.nl-langinfo" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>nl_langinfo</refname>
<refpurpose>Query language and locale information</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>string</type><type>false</type></type><methodname>nl_langinfo</methodname>
<methodparam><type>int</type><parameter>item</parameter></methodparam>
</methodsynopsis>
<para>
<function>nl_langinfo</function> is used to access individual elements of
the locale categories. Unlike <function>localeconv</function>, which
returns all of the elements, <function>nl_langinfo</function> allows you
to select any specific element.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>item</parameter></term>
<listitem>
<para>
<parameter>item</parameter> may be an integer value of the element or the
constant name of the element. The following is a list of constant names
for <parameter>item</parameter> that may be used and their description.
Some of these constants may not be defined or hold no value for certain
locales.
<table>
<title>nl_langinfo Constants</title>
<tgroup cols="2">
<colspec colname="c1"/>
<colspec colname="c2"/>
<thead>
<row>
<entry>Constant</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry namest="c1" nameend="c2" align="center"><emphasis><constant>LC_TIME</constant> Category Constants</emphasis></entry>
</row>
<row>
<entry><constant>ABDAY_<replaceable>(1-7)</replaceable></constant></entry>
<entry>Abbreviated name of n-th day of the week.</entry>
</row>
<row>
<entry><constant>DAY_<replaceable>(1-7)</replaceable></constant></entry>
<entry>Name of the n-th day of the week (DAY_1 = Sunday).</entry>
</row>
<row>
<entry><constant>ABMON_<replaceable>(1-12)</replaceable></constant></entry>
<entry>Abbreviated name of the n-th month of the year.</entry>
</row>
<row>
<entry><constant>MON_<replaceable>(1-12)</replaceable></constant></entry>
<entry>Name of the n-th month of the year.</entry>
</row>
<row>
<entry><constant>AM_STR</constant></entry>
<entry>String for Ante meridian.</entry>
</row>
<row>
<entry><constant>PM_STR</constant></entry>
<entry>String for Post meridian.</entry>
</row>
<row>
<entry><constant>D_T_FMT</constant></entry>
<entry>String that can be used as the format string for <function>strftime</function> to represent time and date.</entry>
</row>
<row>
<entry><constant>D_FMT</constant></entry>
<entry>String that can be used as the format string for <function>strftime</function> to represent date.</entry>
</row>
<row>
<entry><constant>T_FMT</constant></entry>
<entry>String that can be used as the format string for <function>strftime</function> to represent time.</entry>
</row>
<row>
<entry><constant>T_FMT_AMPM</constant></entry>
<entry>String that can be used as the format string for <function>strftime</function> to represent time in 12-hour format with ante/post meridian.</entry>
</row>
<row>
<entry><constant>ERA</constant></entry>
<entry>Alternate era.</entry>
</row>
<row>
<entry><constant>ERA_YEAR</constant></entry>
<entry>Year in alternate era format.</entry>
</row>
<row>
<entry><constant>ERA_D_T_FMT</constant></entry>
<entry>Date and time in alternate era format (string can be used in <function>strftime</function>).</entry>
</row>
<row>
<entry><constant>ERA_D_FMT</constant></entry>
<entry>Date in alternate era format (string can be used in <function>strftime</function>).</entry>
</row>
<row>
<entry><constant>ERA_T_FMT</constant></entry>
<entry>Time in alternate era format (string can be used in <function>strftime</function>).</entry>
</row>
<row>
<entry namest="c1" nameend="c2" align="center"><emphasis><constant>LC_MONETARY</constant> Category Constants</emphasis></entry>
</row>
<row>
<entry><constant>INT_CURR_SYMBOL</constant></entry>
<entry>International currency symbol.</entry>
</row>
<row>
<entry><constant>CURRENCY_SYMBOL</constant></entry>
<entry>Local currency symbol.</entry>
</row>
<row>
<entry><constant>CRNCYSTR</constant></entry>
<entry>Same value as <constant>CURRENCY_SYMBOL</constant>.</entry>
</row>
<row>
<entry><constant>MON_DECIMAL_POINT</constant></entry>
<entry>Decimal point character.</entry>
</row>
<row>
<entry><constant>MON_THOUSANDS_SEP</constant></entry>
<entry>Thousands separator (groups of three digits).</entry>
</row>
<row>
<entry><constant>MON_GROUPING</constant></entry>
<entry>Like <literal>"grouping"</literal> element.</entry>
</row>
<row>
<entry><constant>POSITIVE_SIGN</constant></entry>
<entry>Sign for positive values.</entry>
</row>
<row>
<entry><constant>NEGATIVE_SIGN</constant></entry>
<entry>Sign for negative values.</entry>
</row>
<row>
<entry><constant>INT_FRAC_DIGITS</constant></entry>
<entry>International fractional digits.</entry>
</row>
<row>
<entry><constant>FRAC_DIGITS</constant></entry>
<entry>Local fractional digits.</entry>
</row>
<row>
<entry><constant>P_CS_PRECEDES</constant></entry>
<entry>Returns 1 if <constant>CURRENCY_SYMBOL</constant> precedes a positive value.</entry>
</row>
<row>
<entry><constant>P_SEP_BY_SPACE</constant></entry>
<entry>Returns 1 if a space separates <constant>CURRENCY_SYMBOL</constant> from a positive value.</entry>
</row>
<row>
<entry><constant>N_CS_PRECEDES</constant></entry>
<entry>Returns 1 if <constant>CURRENCY_SYMBOL</constant> precedes a negative value.</entry>
</row>
<row>
<entry><constant>N_SEP_BY_SPACE</constant></entry>
<entry>Returns 1 if a space separates <constant>CURRENCY_SYMBOL</constant> from a negative value.</entry>
</row>
<row>
<entry><constant>P_SIGN_POSN</constant></entry>
<entry morerows="1" valign="middle">
<itemizedlist>
<listitem>
<simpara>
Returns 0 if parentheses surround the quantity and <constant>CURRENCY_SYMBOL</constant>.
</simpara>
</listitem>
<listitem>
<simpara>
Returns 1 if the sign string precedes the quantity and <constant>CURRENCY_SYMBOL</constant>.
</simpara>
</listitem>
<listitem>
<simpara>
Returns 2 if the sign string follows the quantity and <constant>CURRENCY_SYMBOL</constant>.
</simpara>
</listitem>
<listitem>
<simpara>
Returns 3 if the sign string immediately precedes the <constant>CURRENCY_SYMBOL</constant>.
</simpara>
</listitem>
<listitem>
<simpara>
Returns 4 if the sign string immediately follows the <constant>CURRENCY_SYMBOL</constant>.
</simpara>
</listitem>
</itemizedlist>
</entry>
</row>
<row>
<entry><constant>N_SIGN_POSN</constant></entry>
</row>
<row>
<entry namest="c1" nameend="c2" align="center"><emphasis><constant>LC_NUMERIC</constant> Category Constants</emphasis></entry>
</row>
<row>
<entry><constant>DECIMAL_POINT</constant></entry>
<entry>Decimal point character.</entry>
</row>
<row>
<entry><constant>RADIXCHAR</constant></entry>
<entry>Same value as <constant>DECIMAL_POINT</constant>.</entry>
</row>
<row>
<entry><constant>THOUSANDS_SEP</constant></entry>
<entry>Separator character for thousands (groups of three digits).</entry>
</row>
<row>
<entry><constant>THOUSEP</constant></entry>
<entry>Same value as <constant>THOUSANDS_SEP</constant>.</entry>
</row>
<row>
<entry><constant>GROUPING</constant></entry>
<entry/>
</row>
<row>
<entry namest="c1" nameend="c2" align="center"><emphasis><constant>LC_MESSAGES</constant> Category Constants</emphasis></entry>
</row>
<row>
<entry><constant>YESEXPR</constant></entry>
<entry>Regex string for matching <literal>"yes"</literal> input.</entry>
</row>
<row>
<entry><constant>NOEXPR</constant></entry>
<entry>Regex string for matching <literal>"no"</literal> input.</entry>
</row>
<row>
<entry><constant>YESSTR</constant></entry>
<entry>Output string for <literal>"yes"</literal>.</entry>
</row>
<row>
<entry><constant>NOSTR</constant></entry>
<entry>Output string for <literal>"no"</literal>.</entry>
</row>
<row>
<entry namest="c1" nameend="c2" align="center"><emphasis><constant>LC_CTYPE</constant> Category Constants</emphasis></entry>
</row>
<row>
<entry><constant>CODESET</constant></entry>
<entry>Return a string with the name of the character encoding.</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the element as a string, or &false; if <parameter>item</parameter>
is not valid.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>nl_langinfo</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
var_dump(nl_langinfo(CODESET));
var_dump(nl_langinfo(YESEXPR));
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
string(14) "ANSI_X3.4-1968"
string(5) "^[yY]"
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
¬e.no-windows;
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>setlocale</function></member>
<member><function>localeconv</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
|