2010-03-28 22:10:10 +00:00
<?xml version="1.0" encoding="utf-8"?>
2009-07-11 09:08:43 +00:00
<!-- $Revision$ -->
2007-06-20 22:25:43 +00:00
<refentry xmlns= "http://docbook.org/ns/docbook" xml:id= "function.nl-langinfo" >
2007-06-11 22:13:26 +00:00
<refnamediv >
<refname > nl_langinfo</refname>
<refpurpose > Query language and locale information</refpurpose>
</refnamediv>
2007-06-11 22:14:07 +00:00
<refsect1 role= "description" >
&reftitle.description;
2007-06-11 22:13:26 +00:00
<methodsynopsis >
<type > string</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>
2007-06-11 22:14:07 +00:00
</refsect1>
<refsect1 role= "parameters" >
&reftitle.parameters;
2007-06-11 22:13:26 +00:00
<para >
2007-06-11 22:14:07 +00:00
<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 > LC_TIME Category Constants</emphasis> </entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > ABDAY_(1-7)</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > Abbreviated name of n-th day of the week.</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > DAY_(1-7)</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > Name of the n-th day of the week (DAY_1 = Sunday).</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > ABMON_(1-12)</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > Abbreviated name of the n-th month of the year.</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > MON_(1-12)</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > Name of the n-th month of the year.</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > AM_STR</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > String for Ante meridian.</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > PM_STR</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > String for Post meridian.</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > D_T_FMT</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > String that can be used as the format string for <function > strftime</function> to represent time and date.</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > D_FMT</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > String that can be used as the format string for <function > strftime</function> to represent date.</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > T_FMT</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > String that can be used as the format string for <function > strftime</function> to represent time.</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > T_FMT_AMPM</constant> </entry>
2007-06-11 22:14:07 +00:00
<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 >
2009-05-03 22:22:31 +00:00
<entry > <constant > ERA</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > Alternate era.</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > ERA_YEAR</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > Year in alternate era format.</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > ERA_D_T_FMT</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > Date and time in alternate era format (string can be used in <function > strftime</function> ).</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > ERA_D_FMT</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > Date in alternate era format (string can be used in <function > strftime</function> ).</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > ERA_T_FMT</constant> </entry>
2007-06-11 22:14:07 +00:00
<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 > LC_MONETARY Category Constants</emphasis> </entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > INT_CURR_SYMBOL</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > International currency symbol.</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > CURRENCY_SYMBOL</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > Local currency symbol.</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > CRNCYSTR</constant> </entry>
<entry > Same value as <constant > CURRENCY_SYMBOL</constant> .</entry>
2007-06-11 22:14:07 +00:00
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > MON_DECIMAL_POINT</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > Decimal point character.</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > MON_THOUSANDS_SEP</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > Thousands separator (groups of three digits).</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > MON_GROUPING</constant> </entry>
<entry > Like <literal > "grouping"</literal> element.</entry>
2007-06-11 22:14:07 +00:00
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > POSITIVE_SIGN</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > Sign for positive values.</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > NEGATIVE_SIGN</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > Sign for negative values.</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > INT_FRAC_DIGITS</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > International fractional digits.</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > FRAC_DIGITS</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > Local fractional digits.</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > P_CS_PRECEDES</constant> </entry>
<entry > Returns 1 if <constant > CURRENCY_SYMBOL</constant> precedes a positive value.</entry>
2007-06-11 22:14:07 +00:00
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > P_SEP_BY_SPACE</constant> </entry>
<entry > Returns 1 if a space separates <constant > CURRENCY_SYMBOL</constant> from a positive value.</entry>
2007-06-11 22:14:07 +00:00
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > N_CS_PRECEDES</constant> </entry>
<entry > Returns 1 if <constant > CURRENCY_SYMBOL</constant> precedes a negative value.</entry>
2007-06-11 22:14:07 +00:00
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > N_SEP_BY_SPACE</constant> </entry>
<entry > Returns 1 if a space separates <constant > CURRENCY_SYMBOL</constant> from a negative value.</entry>
2007-06-11 22:14:07 +00:00
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > P_SIGN_POSN</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry morerows= "1" valign= "middle" >
<itemizedlist >
<listitem >
<simpara >
2009-05-03 22:22:31 +00:00
Returns 0 if parentheses surround the quantity and <constant > CURRENCY_SYMBOL</constant> .
2007-06-11 22:14:07 +00:00
</simpara>
</listitem>
<listitem >
<simpara >
2009-05-03 22:22:31 +00:00
Returns 1 if the sign string precedes the quantity and <constant > CURRENCY_SYMBOL</constant> .
2007-06-11 22:14:07 +00:00
</simpara>
</listitem>
<listitem >
<simpara >
2009-05-03 22:22:31 +00:00
Returns 2 if the sign string follows the quantity and <constant > CURRENCY_SYMBOL</constant> .
2007-06-11 22:14:07 +00:00
</simpara>
</listitem>
<listitem >
<simpara >
2009-05-03 22:22:31 +00:00
Returns 3 if the sign string immediately precedes the <constant > CURRENCY_SYMBOL</constant> .
2007-06-11 22:14:07 +00:00
</simpara>
</listitem>
<listitem >
<simpara >
2009-05-03 22:22:31 +00:00
Returns 4 if the sign string immediately follows the <constant > CURRENCY_SYMBOL</constant> .
2007-06-11 22:14:07 +00:00
</simpara>
</listitem>
</itemizedlist>
</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > N_SIGN_POSN</constant> </entry>
2007-06-11 22:14:07 +00:00
</row>
<row >
<entry namest= "c1" nameend= "c2" align= "center" > <emphasis > LC_NUMERIC Category Constants</emphasis> </entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > DECIMAL_POINT</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > Decimal point character.</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > RADIXCHAR</constant> </entry>
<entry > Same value as <constant > DECIMAL_POINT</constant> .</entry>
2007-06-11 22:14:07 +00:00
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > THOUSANDS_SEP</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > Separator character for thousands (groups of three digits).</entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > THOUSEP</constant> </entry>
<entry > Same value as <constant > THOUSANDS_SEP</constant> .</entry>
2007-06-11 22:14:07 +00:00
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > GROUPING</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > </entry>
</row>
<row >
<entry namest= "c1" nameend= "c2" align= "center" > <emphasis > LC_MESSAGES Category Constants</emphasis> </entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > YESEXPR</constant> </entry>
<entry > Regex string for matching <literal > "yes"</literal> input.</entry>
2007-06-11 22:14:07 +00:00
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > NOEXPR</constant> </entry>
<entry > Regex string for matching <literal > "no"</literal> input.</entry>
2007-06-11 22:14:07 +00:00
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > YESSTR</constant> </entry>
<entry > Output string for <literal > "yes"</literal> .</entry>
2007-06-11 22:14:07 +00:00
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > NOSTR</constant> </entry>
<entry > Output string for <literal > "no"</literal> .</entry>
2007-06-11 22:14:07 +00:00
</row>
<row >
<entry namest= "c1" nameend= "c2" align= "center" > <emphasis > LC_CTYPE Category Constants</emphasis> </entry>
</row>
<row >
2009-05-03 22:22:31 +00:00
<entry > <constant > CODESET</constant> </entry>
2007-06-11 22:14:07 +00:00
<entry > Return a string with the name of the character encoding.</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</listitem>
</varlistentry>
</variablelist>
2007-06-11 22:13:26 +00:00
</para>
2007-06-11 22:14:07 +00:00
</refsect1>
<refsect1 role= "returnvalues" >
&reftitle.returnvalues;
2007-06-11 22:13:26 +00:00
<para >
2007-06-11 22:14:07 +00:00
Returns the element as a string, or &false; if <parameter > item</parameter>
is not valid.
2007-06-11 22:13:26 +00:00
</para>
2007-06-11 22:14:07 +00:00
</refsect1>
<refsect1 role= "notes" >
&reftitle.notes;
2007-06-11 22:13:26 +00:00
¬e.no-windows;
2007-06-11 22:14:07 +00:00
</refsect1>
<refsect1 role= "seealso" >
&reftitle.seealso;
2007-06-11 22:13:26 +00:00
<para >
2007-06-11 22:14:07 +00:00
<simplelist >
<member > <function > setlocale</function> </member>
<member > <function > localeconv</function> </member>
</simplelist>
2007-06-11 22:13:26 +00:00
</para>
</refsect1>
2007-06-11 22:14:07 +00:00
2007-06-11 22:13:26 +00:00
</refentry>
2002-04-15 00:12:54 +00:00
<!-- 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
2009-09-25 07:04:39 +00:00
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
2002-04-15 00:12:54 +00:00
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
-->