Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

nl_langinfo

Description

The nl_langinfo String for PHP query language and locale information.

Syntax

nl_langinfo ( int $item ) : string

Parameters

item

item may be an integer value of the element or the constant name of the element. The following is a list of constant names for item that may be used and their description. Some of these constants may not be defined or hold no value for certain locales.

LC_TIME ConstantDescription
ABDAY_(1-7)Abbreviated name of n-th day of the week.
DAY_(1-7)Name of the n-th day of the week (DAY_1 = Sunday).
ABMON_(1-12)Abbreviated name of the n-th month of the year.
MON_(1-12)Name of the n-th month of the year.
AM_STRString for Ante meridian.
PM_STRString for Post meridian.
D_T_FMTString that can be used as the format string for strftime() to represent time and date.
D_FMTString that can be used as the format string for strftime() to represent date.
T_FMTString that can be used as the format string for strftime() to represent time.
T_FMT_AMPMString that can be used as the format string for strftime() to represent time in 12-hour format with ante/post meridian.
ERAAlternate era.
ERA_YEARYear in alternate era format.
ERA_D_T_FMTDate and time in alternate era format (string can be used in strftime()).
ERA_D_FMTDate in alternate era format (string can be used in strftime()).
ERA_T_FMTTime in alternate era format (string can be used in strftime()).
LC_MONETARY ConstantDescription
INT_CURR_SYMBOLInternational currency symbol.
CURRENCY_SYMBOLLocal currency symbol.
CRNCYSTRSame value as CURRENCY_SYMBOL.
MON_DECIMAL_POINTDecimal point character.
MON_THOUSANDS_SEPThousands separator (groups of three digits).
MON_GROUPINGLike "grouping" element.
POSITIVE_SIGNSign for positive values.
NEGATIVE_SIGNSign for negative values.
INT_FRAC_DIGITSInternational fractional digits.
FRAC_DIGITSLocal fractional digits.
P_CS_PRECEDESReturns 1 if CURRENCY_SYMBOL precedes a positive value.
P_SEP_BY_SPACEReturns 1 if a space separates CURRENCY_SYMBOL from a positive value.
N_CS_PRECEDESReturns 1 if CURRENCY_SYMBOL precedes a negative value.
N_SEP_BY_SPACEReturns 1 if a space separates CURRENCY_SYMBOL from a negative value.
P_SIGN_POSNReturns 0 if parentheses surround the quantity and CURRENCY_SYMBOL.
Returns 1 if the sign string precedes the quantity and CURRENCY_SYMBOL.
Returns 2 if the sign string follows the quantity and CURRENCY_SYMBOL.
Returns 3 if the sign string immediately precedes the CURRENCY_SYMBOL.
Returns 4 if the sign string immediately follows the CURRENCY_SYMBOL.
N_SIGN_POSN
LC_NUMERIC ConstantDescription
DECIMAL_POINTDecimal point character.
RADIXCHARSame value as DECIMAL_POINT.
THOUSANDS_SEPSeparator character for thousands (groups of three digits).
THOUSEPSame value as THOUSANDS_SEP.
GROUPING
LC_MESSAGES ConstantDescription
YESEXPRRegex string for matching "yes" input.
NOEXPRRegex string for matching "no" input.
YESSTROutput string for "yes".
NOSTROutput string for "no".
LC_CTYPE ConstantDescription
CODESETReturn a string with the name of the character encoding.

Return

Returns the element as a string, or FALSE if item is not valid.

Examples

1 · item

<?

$item = ABDAY_1;

$return = nl_langinfo($item);
echo $return;

?>
Sun

2 · LC_TIME

<?

echo nl_langinfo(ABDAY_1) . PHP_EOL;
echo nl_langinfo(ABDAY_2) . PHP_EOL;
echo nl_langinfo(ABDAY_3) . PHP_EOL;
echo nl_langinfo(ABDAY_4) . PHP_EOL;
echo nl_langinfo(ABDAY_5) . PHP_EOL;
echo nl_langinfo(ABDAY_6) . PHP_EOL;
echo nl_langinfo(ABDAY_7) . PHP_EOL;
echo nl_langinfo(DAY_1) . PHP_EOL;
echo nl_langinfo(DAY_2) . PHP_EOL;
echo nl_langinfo(DAY_3) . PHP_EOL;
echo nl_langinfo(DAY_4) . PHP_EOL;
echo nl_langinfo(DAY_5) . PHP_EOL;
echo nl_langinfo(DAY_6) . PHP_EOL;
echo nl_langinfo(DAY_7) . PHP_EOL;
echo nl_langinfo(ABMON_1) . PHP_EOL;
echo nl_langinfo(ABMON_2) . PHP_EOL;
echo nl_langinfo(ABMON_3) . PHP_EOL;
echo nl_langinfo(ABMON_4) . PHP_EOL;
echo nl_langinfo(ABMON_5) . PHP_EOL;
echo nl_langinfo(ABMON_6) . PHP_EOL;
echo nl_langinfo(ABMON_7) . PHP_EOL;
echo nl_langinfo(ABMON_8) . PHP_EOL;
echo nl_langinfo(ABMON_9) . PHP_EOL;
echo nl_langinfo(ABMON_10) . PHP_EOL;
echo nl_langinfo(ABMON_11) . PHP_EOL;
echo nl_langinfo(ABMON_12) . PHP_EOL;
echo nl_langinfo(MON_1) . PHP_EOL;
echo nl_langinfo(MON_2) . PHP_EOL;
echo nl_langinfo(MON_3) . PHP_EOL;
echo nl_langinfo(MON_4) . PHP_EOL;
echo nl_langinfo(MON_5) . PHP_EOL;
echo nl_langinfo(MON_6) . PHP_EOL;
echo nl_langinfo(MON_7) . PHP_EOL;
echo nl_langinfo(MON_8) . PHP_EOL;
echo nl_langinfo(MON_9) . PHP_EOL;
echo nl_langinfo(MON_10) . PHP_EOL;
echo nl_langinfo(MON_11) . PHP_EOL;
echo nl_langinfo(MON_12) . PHP_EOL;
echo nl_langinfo(AM_STR) . PHP_EOL;
echo nl_langinfo(PM_STR) . PHP_EOL;
echo nl_langinfo(D_T_FMT) . PHP_EOL;
echo nl_langinfo(D_FMT) . PHP_EOL;
echo nl_langinfo(T_FMT) . PHP_EOL;
echo nl_langinfo(T_FMT_AMPM) . PHP_EOL;
echo nl_langinfo(ERA) . PHP_EOL;
//echo nl_langinfo(ERA_YEAR) . PHP_EOL;
echo nl_langinfo(ERA_D_T_FMT) . PHP_EOL;
echo nl_langinfo(ERA_D_FMT) . PHP_EOL;
echo nl_langinfo(ERA_T_FMT);

?>
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
January
February
March
April
May
June
July
August
September
October
November
December
AM
PM
%a %b %e %H:%M:%S %Y
%m/%d/%y
%H:%M:%S
%I:%M:%S %p



3 · LC_MONETARY

<?

//echo nl_langinfo(INT_CURR_SYMBOL) . PHP_EOL;
//echo nl_langinfo(CURRENCY_SYMBOL) . PHP_EOL;
echo nl_langinfo(CRNCYSTR) . PHP_EOL;
//echo nl_langinfo(MON_DECIMAL_POINT) . PHP_EOL;
//echo nl_langinfo(MON_THOUSANDS_SEP) . PHP_EOL;
//echo nl_langinfo(MON_GROUPING) . PHP_EOL;
//echo nl_langinfo(POSITIVE_SIGN) . PHP_EOL;
//echo nl_langinfo(NEGATIVE_SIGN) . PHP_EOL;
//echo nl_langinfo(INT_FRAC_DIGITS) . PHP_EOL;
//echo nl_langinfo(FRAC_DIGITS) . PHP_EOL;
//echo nl_langinfo(P_CS_PRECEDES) . PHP_EOL;
//echo nl_langinfo(P_SEP_BY_SPACE) . PHP_EOL;
//echo nl_langinfo(N_CS_PRECEDES) . PHP_EOL;
//echo nl_langinfo(N_SEP_BY_SPACE) . PHP_EOL;
//echo nl_langinfo(P_SIGN_POSN ) . PHP_EOL;
//echo nl_langinfo(N_SIGN_POSN);

?>
-

4 · LC_NUMERIC

<?

//echo nl_langinfo(DECIMAL_POINT) . PHP_EOL;
echo nl_langinfo(RADIXCHAR) . PHP_EOL;
//echo nl_langinfo(THOUSANDS_SEP) . PHP_EOL;
echo nl_langinfo(THOUSEP) . PHP_EOL;
//echo nl_langinfo(GROUPING);

?>
.

5 · LC_MESSAGES

<?

echo nl_langinfo(YESEXPR) . PHP_EOL;
echo nl_langinfo(NOEXPR) . PHP_EOL;
//echo nl_langinfo(YESSTR) . PHP_EOL;
//echo nl_langinfo(NOSTR);

?>
^[yY]
^[nN]

6 · LC_CTYPE

<?

echo nl_langinfo(CODESET);

?>
ANSI_X3.4-1968
HomeMenu