Get currency symbol in PHP

前端 未结 8 828
春和景丽
春和景丽 2020-12-14 00:07

Let\'s start with simple piece of code to format money with NumberFormatter:

$formatter = new NumberFormatter(\'en_US\', NumberFormatter::CURREN         


        
8条回答
  •  悲&欢浪女
    2020-12-14 01:07

    Zend_Locale::getTranslationList('CurrencySymbol')
    

    Will give you an associative array of 3 letter currency codes to their symbol.

    Can then use like this:

    $curArr = Zend_Locale::getTranslationList('CurrencySymbol');
    echo $curArr['GBP'];
    

提交回复
热议问题