Get currency symbol in PHP

前端 未结 8 833
春和景丽
春和景丽 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 00:53

    I achieved this using https://github.com/symfony/Intl:

    Symfony\Component\Intl\Intl::getCurrencyBundle()->getCurrencySymbol('EUR')
    

    returns

    '€'.
    

提交回复
热议问题