【发布时间】:2011-08-09 03:24:17
【问题描述】:
可能重复:
How to get the default currency from the PHP Intl ( ICU library )
我在 php 中使用 intl 扩展来处理本地化内容和格式化内容。由于我已经知道 en_US 等语言环境,是否可以从 PHP 中获取语言环境的货币?
如果语言环境是 en_US,我应该得到 $ 或 USD,如果语言环境是 en_AU,我应该得到 $ 或 AUD。
我需要将 3 个字母的 ISO 4217 货币代码传递给 numberFormatter::Currency。
谢谢:)
【问题讨论】:
-
我正在使用 intl 扩展中的 numberformatter::Currency 进行格式化,所以这种方法不起作用。
-
查看@Gordon 的回答:stackoverflow.com/a/8325456/419
标签: php localization currency