Definition
The nl_langinfo() function returns specific local information. This function does not work on Windows platforms.
Syntax
nl_langinfo(element)
Parameters
Parameter | Description |
---|---|
element |
Required. Specifies which element to return. Must be one of the following elements: Time and Calendar: ABDAY_(1-7) - Abbreviated name of the numbered day of the weekDAY_(1-7) - Name of the numbered day of the week (DAY_1 = Sunday)ABMON_(1-12) - Abbreviated name of the numbered month of the yearMON_(1-12) - Name of the numbered month of the yearAM_STR - String for Ante meridianPM_STR - String for Post meridianD_T_FMT - String that can be used as the format string for strftime() to represent time and dateD_FMT - String that can be used as the format string for strftime() to represent dateT_FMT - String that can be used as the format string for strftime() to represent timeT_FMT_AMPM - String that can be used as the format string for strftime() to represent time in 12-hour format with ante/post meridianERA - Alternate eraERA_YEAR - Year in alternate era formatERA_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())Monetary Category: INT_CURR_SYMBOL - Currency symbol (example: USD)CURRENCY_SYMBOL - Currency symbol (example: $)CRNCYSTR - Same as CURRENCY_SYMBOLMON_DECIMAL_POINT - Monetary decimal point characterMON_THOUSANDS_SEP - Monetary thousands separatorPOSITIVE_SIGN - Positive value characterNEGATIVE_SIGN -Negative value characterMON_GROUPING - Array displaying how monetary numbers are grouped (example: 1 000 000)INT_FRAC_DIGITS - International fractional digitsFRAC_DIGITS - Local fractional digitsP_CS_PRECEDES - True (1) if currency symbol is placed in front of a positive value, False (0) if it is placed behindP_SEP_BY_SPACE - True (1) if there is a spaces between the currency symbol and a positive value, False (0) otherwiseN_CS_PRECEDES - True (1) if currency symbol is placed in front of a negative value, False (0) if it is placed behindN_SEP_BY_SPACE - True (1) if there is a spaces between the currency symbol and a negative value, False (0) otherwiseP_SIGN_POSN - Formatting setting. Possible return values:0 - Parentheses surround the quantity and currency symbol1 - The sign string is placed in front of the quantity and currency symbol2 - The sign string is placed after the quantity and currency symbol3 - The sign string is placed immediately in front of the currency symbol4 - The sign string is placed immediately after the currency symbolN_SIGN_POSN - Formatting setting. Possible return values:0 - Parentheses surround the quantity and currency symbol1 - The sign string is placed in front of the quantity and currency symbol2 - The sign string is placed after the quantity and currency symbol3 - The sign string is placed immediately in front of the currency symbol4 - The sign string is placed immediately after the currency symbolNumeric Category: DECIMAL_POINT - Decimal point characterRADIXCHAR - Same as DECIMAL_POINTTHOUSANDS_SEP - Separator character for thousandsTHOUSEP - Same as THOUSANDS_SEPGROUPING - Array displaying how numbers are grouped (example: 1 000 000)Messaging Category: YESEXPR - Regex string for matching 'yes' inputNOEXPR - Regex string for matching 'no' inputYESSTR - Output string for 'yes'NOSTR - Output string for 'no'Code set Category: CODESET - Return a string with the name of the character encoding. |
Example
<?php
echo nl_langinfo(CODESET);