PHP nl_langinfo() Function
PHP String Reference Manual
Definition and Usage
The nl_langinfo() function returns specified locale information.
**Note:** This function does not work on Windows platforms.
**Tip:** Unlike localeconv() which returns all locale formatting information, the nl_langinfo() function returns the specified information.
Syntax
nl_langinfo(
element
)
| Parameters | Description |
|---|---|
| element | Required. Specifies which element to return. Must be one of the elements listed below:
Time and calendar: |
Currency categories:
- INT_CURR_SYMBOL - Currency symbol (e.g. USD)
- CURRENCY_SYMBOL - Currency symbol (e.g. $)
- CRNCYSTR - Similar to CURRENCY_SYMBOL
- MON_DECIMAL_POINT - Currency decimal point character
- MON_THOUSANDS_SEP - Currency thousands separator
- POSITIVE_SIGN - Positive sign character
- NEGATIVE_SIGN - Negative sign character
- MON_GROUPING - Array showing the currency digit grouping form (e.g. 1 000 000)
- INT_FRAC_DIGITS - International fractional digits
- FRAC_DIGITS - Local fractional digits
- P_CS_PRECEDES - True (1) if the currency symbol is displayed before a positive value, False (0) if displayed after
- P_SEP_BY_SPACE - True (1) if a space is included between the currency symbol and a positive value, otherwise False (0)
- N_CS_PRECEDES - True (1) if the currency symbol is displayed before a negative value, False (0) if displayed after
- N_SEP_BY_SPACE - True (1) if a space is included between the currency symbol and a negative value, otherwise False (0)
- P_SIGN_POSN - Formatting setting, possible return values:
- 0 - Write the quantity and currency symbol inside parentheses
- 1 - Prefix the quantity and currency symbol with a + sign
- 2 - Suffix the quantity and currency symbol with a + sign
- 3 - Prefix the + sign directly before the currency symbol
- 4 - Suffix the + sign directly after the currency symbol
- N_SIGN_POSN - Formatting setting, possible return values:
- 0 - Write the quantity and currency symbol inside parentheses
- 1 - Prefix the quantity and currency symbol with a - sign
- 2 - Suffix the quantity and currency symbol with a - sign
- 3 - Prefix the - sign directly before the currency symbol
- 4 - Suffix the - sign directly after the currency symbol
Numeric categories:
- DECIMAL_POINT - Decimal point character
- RADIXCHAR - Similar to DECIMAL_POINT
- THOUSANDS_SEP - Thousands separator character
- THOUSEP - Similar to THOUSANDS_SEP
- GROUPING - Array showing the digit grouping form (e.g. 1 000 000)
Messaging categories:
- YESEXPR - Regex string matching 'yes' input
- NOEXPR - Regex string matching 'no' input
- YESSTR - Output string for 'yes'
- NOSTR - Output string for 'no'
Codeset categories:
- CODESET returns a string with the character encoding name.
Technical Details
| Return Value: | Returns the specified information on success, or FALSE on failure. |
|---|---|
| PHP Version: | 4.1.0+ |
PHP String Reference Manual