PHP localeconv () Function instance explanation, localeconv example explanation
The PHP localeconv () function returns an array containing local numbers and currency format information. This article introduces the usage and basic example of PHP localeconv () function to code farming. Need to the code farmers can refer to.
Definition and usage
The Localeconv () function returns an array containing local numbers and currency format information.
The Localeconv () function returns the following array element:
- [Decimal_point]-Decimal character
- [THOUSANDS_SEP]-Thousands separator
- [Int_curr_symbol]-Currency symbol (ex: USD)
- [Currency_symbol]-Currency symbol (for example: $)
- [Mon_decimal_point]-Currency decimal character
- [MON_THOUSANDS_SEP]-Currency thousand separator
- [Positive_sign]-positive character
- [Negative_sign]-negative character
- [Int_frac_digits]-International general decimal digits
- [Frac_digits]-Local general decimal digits
- [P_cs_precedes]-True (1) If the currency symbol is displayed before a positive value, False (0) If it is displayed after a positive value
- [P_sep_by_space]-True (1) If a space is included between the currency symbol and the positive value, otherwise False (0)
- [N_cs_precedes]-True (1) If the currency symbol is displayed before a negative value, False (0) If it is displayed after a negative value
- [N_sep_by_space]-True (1) If a space is included between the currency symbol and the negative value, False (0)
- [P_sign_posn]-formatting options:
- 0-Write the quantity and currency symbol in parentheses
- 1-Add the + sign before the quantity and currency symbol
- 2-Add the + sign after the number and currency symbol
- 3-Add the + sign directly before the currency symbol
- 4-Add the + sign directly after the currency symbol
- [N_sign_posn]-formatting options:
- 0-Write the quantity and currency symbol in parentheses
- 1-Before the number and currency symbol plus-number
- 2-After the number and currency symbol plus-number
- 3-Directly before the currency symbol Plus-No.
- 4-Directly after the currency symbol plus-number
- [Grouping]-displays an array of combinations of numbers (for example: 3 indication 1 000 000)
- [Mon_grouping]-Displays an array of currency number combinations (for example: 2 indication 1 00 00 00)
Tip: If you need to define local settings, see the setlocale () function.
Tip: To see all available language codes, please visit our Language Code reference manual.
Grammar
Localeconv ()
Technical details
return value: |
Returns the current local data based on the setlocale () setting. |
PHP version: |
4.0.5+ |
Instance
Find local digital formatting information for the United States:
Run online
Original address: http://www.manongjc.com/article/817.html
Related reading:
PHP setlocale () function set region information (geo-information)
HTML Web page lang language settings and references
http://www.bkjia.com/PHPjc/1126418.html www.bkjia.com true http://www.bkjia.com/PHPjc/1126418.html techarticle the PHP localeconv () Function example explains, localeconv instance explains the PHP localeconv () function returns an array containing local numbers and currency format information. This article to the Code Farm introduction PHP Localeco ...