查找美国本地的数字格式化信息:
<?php setlocale(LC_ALL,"US"); $locale_info = localeconv(); print_r($locale_info); ?>
运行结果:
Array
(
[decimal_point] => .
[thousands_sep] => ,
[int_curr_symbol] => USD
[currency_symbol] => $
[mon_decimal_point] => .
[mon_thousands_sep] => ,
[positive_sign] =>
[negative_sign] => -
[int_frac_digits] => 2
[frac_digits] => 2
[p_cs_precedes] => 1
[p_sep_by_space] => 0
[n_cs_precedes] => 1
[n_sep_by_space] => 0
[p_sign_posn] => 3
[n_sign_posn] => 0
[grouping] => Array
(
[0] => 3
)
[mon_grouping] => Array
(
[0] => 3
)
)
localeconv() 函数返回一个包含本地数字及货币格式信息的数组。
localeconv() 函数返回以下数组元素:
提示:如需定义本地设置,请查看 setlocale() 函数。
提示:如需查看所有可用的语言代码,请访问我们的语言代码参考手册。
localeconv()
| 返回值: | 返回基于 setlocale() 设置的当前本地的数据。 |
|---|---|
| PHP 版本: | 4.0.5+ |
PHP String 参考手册