Home >>PHP String Functions >PHP localeconv() Function
PHP localeconv() function is used to get United States locale numeric formatting information. This function is a non-parameterized function, which means this function does not need any value to be pass as input. This function returns an array as result which contains local numeric and monetary formatting information.
Syntax:
localeconv();
Array Elements | Description |
---|---|
decimal_point | Represents decimal point character. |
thousand_sep | Represents thousands separator. |
int_curr_symbol | International Currency Symbol (USD). |
currency_symbol | Local currency symbol ($). |
mon_decimal_point | Represents Monetary decimal point character. |
mon_thousands_sep | Represents Monetary thousands separator. |
positive_sign | Positive value sign. |
negative_sign | Negative value sign. |
int_frac_digits | Represents International fractional digits. |
Represent | Local fractional digits. |
Here is an example of localeconv() function in PHP:
<html> <body> <?php setlocale(LC_ALL,"US"); $locale = localeconv(); print_r($locale); ?> </body> </html>
Here is an another example of localeconv() function in PHP:
<html> <body> <?php setlocale(LC_MONETARY,"US"); $localeinfo =localeconv(); print_r($localeinfo); ?> </body> </html>