1

In the Symfony Intl bundle, there exists a method to get the list of all currencies. Is there any way to get the mapping between a country and the currencies used in this country?

e.g. I want to get the list of currencies used in Serbia.

Obaid Maroof
  • 1,523
  • 2
  • 19
  • 40

1 Answers1

3

Code:

echo (new NumberFormatter(
    Zend_Locale::getLocaleToTerritory('RS'),
    NumberFormatter::CURRENCY
))->getTextAttribute(NumberFormatter::CURRENCY_CODE);

Output:

RSD

As you can see, I used Zend Locale.

Greetings from Serbia. :)

umpirsky
  • 9,902
  • 13
  • 71
  • 96
  • 1
    NumberFormatter accepts English as a language for any country. So just use `en_` plus your country code. – Jonny Aug 03 '16 at 10:02