nl_langinfo
Description
The nl_langinfo of 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 Constant | Description |
---|---|
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_STR | String for Ante meridian. |
PM_STR | String for Post meridian. |
D_T_FMT | String that can be used as the format string for strftime() to represent time and date. |
D_FMT | String that can be used as the format string for strftime() to represent date. |
T_FMT | String that can be used as the format string for strftime() to represent time. |
T_FMT_AMPM | String that can be used as the format string for strftime() to represent time in 12-hour format with ante/post meridian. |
ERA | Alternate era. |
ERA_YEAR | Year in alternate era format. |
ERA_D_T_FMT | Date and time in alternate era format (string can be used in strftime()). |
ERA_D_FMT | Date in alternate era format (string can be used in strftime()). |
ERA_T_FMT | Time in alternate era format (string can be used in strftime()). |
LC_MONETARY Constant | Description |
INT_CURR_SYMBOL | International currency symbol. |
CURRENCY_SYMBOL | Local currency symbol. |
CRNCYSTR | Same value as CURRENCY_SYMBOL. |
MON_DECIMAL_POINT | Decimal point character. |
MON_THOUSANDS_SEP | Thousands separator (groups of three digits). |
MON_GROUPING | Like "grouping" element. |
POSITIVE_SIGN | Sign for positive values. |
NEGATIVE_SIGN | Sign for negative values. |
INT_FRAC_DIGITS | International fractional digits. |
FRAC_DIGITS | Local fractional digits. |
P_CS_PRECEDES | Returns 1 if CURRENCY_SYMBOL precedes a positive value. |
P_SEP_BY_SPACE | Returns 1 if a space separates CURRENCY_SYMBOL from a positive value. |
N_CS_PRECEDES | Returns 1 if CURRENCY_SYMBOL precedes a negative value. |
N_SEP_BY_SPACE | Returns 1 if a space separates CURRENCY_SYMBOL from a negative value. |
P_SIGN_POSN | Returns 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 Constant | Description |
DECIMAL_POINT | Decimal point character. |
RADIXCHAR | Same value as DECIMAL_POINT. |
THOUSANDS_SEP | Separator character for thousands (groups of three digits). |
THOUSEP | Same value as THOUSANDS_SEP. |
GROUPING | |
LC_MESSAGES Constant | Description |
YESEXPR | Regex string for matching "yes" input. |
NOEXPR | Regex string for matching "no" input. |
YESSTR | Output string for "yes". |
NOSTR | Output string for "no". |
LC_CTYPE Constant | Description |
CODESET | Return 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
Links
String
- addcslashes
- addslashes
- bin2hex
- chop
- chr
- chunk_split
- convert_uudecode
- convert_uuencode
- count_chars
- crc32
- crypt
- echo
- explode
- fprintf
- get_html_translation_table
- hebrev
- hebrevc
- hex2bin
- html_entity_decode
- htmlentities
- htmlspecialchars
- htmlspecialchars_decode
- implode
- join
- lcfirst
- levenshtein
- localeconv
- ltrim
- md5
- md5_file
- metaphone
- nl2br
- number_format
- ord
- parse_str
- printf
- quoted_printable_decode
- quoted_printable_encode
- quotemeta
- rtrim
- setlocale
- sha1
- sha1_file
- similar_text
- soundex
- sprintf
- sscanf
- str_contains
- str_decrement
- str_ends_with
- str_getcsv
- str_increment
- str_ireplace
- str_pad
- str_repeat
- str_replace
- str_rot13
- str_shuffle
- str_split
- str_starts_with
- str_word_count
- strcasecmp
- strchr
- strcmp
- strcoll
- strcspn
- strip_tags
- stripcslashes
- stripos
- stripslashes
- stristr
- strlen
- strnatcasecmp
- strnatcmp
- strncasecmp
- strncmp
- strpbrk
- strpos
- strrchr
- strrev
- strripos
- strrpos
- strspn
- strstr
- strtok
- strtolower
- strtoupper
- strtr
- substr
- substr_compare
- substr_count
- substr_replace
- trim
- ucfirst
- ucwords
- vfprintf
- vprintf
- vsprintf
- wordwrap