A class for getting currency-related data from cldr.
More...
|
static | getCurrenciesByCountry ( $country_code) |
| getCurrenciesByCountry returns an ordered list of ISO 4217 3-character currency codes that are valid in the specified country.
|
|
static | getDecimalPlaces ( $currency_code) |
| getDecimalPlaces returns a number specifying how many decimal places the requested currency supports.
|
|
static | getSymbol ( $currency_code, $language_code, $country_code=null) |
| getSymbol returns a symbol for the relevant currency that should be recognized notation for that currency in the specified language and optionally specified country.
|
|
|
static | loadData ( $data) |
| Loads the file which contains the relevant data.
|
|
A class for getting currency-related data from cldr.
- Author
- Katie Horn
- Note
- Copyright © 2007-2013
-
GPL-2.0-or-later
Definition at line 10 of file CldrCurrencies.php.
◆ getCurrenciesByCountry()
static CldrCurrency::getCurrenciesByCountry |
( |
| $country_code | ) |
|
|
static |
getCurrenciesByCountry returns an ordered list of ISO 4217 3-character currency codes that are valid in the specified country.
- Parameters
-
string | $country_code | ISO 3166-1 Alpha-2 country code |
- Returns
- array An array of indicies and currency codes, or an empty array if no valid currency is found.
Definition at line 118 of file CldrCurrencies.php.
References loadData().
◆ getDecimalPlaces()
static CldrCurrency::getDecimalPlaces |
( |
| $currency_code | ) |
|
|
static |
getDecimalPlaces returns a number specifying how many decimal places the requested currency supports.
- Parameters
-
string | $currency_code | ISO 4217 3-character currency code. |
- Returns
- int The number of decimal places for the relevant currency (0 for nonfractional)
Definition at line 134 of file CldrCurrencies.php.
References loadData().
◆ getSymbol()
static CldrCurrency::getSymbol |
( |
| $currency_code, |
|
|
| $language_code, |
|
|
| $country_code = null ) |
|
static |
getSymbol returns a symbol for the relevant currency that should be recognized notation for that currency in the specified language and optionally specified country.
NOTE: This function will always perform more reliably if a country is specified
- Parameters
-
string | $currency_code | ISO 4217 3-character currency code. |
string | $language_code | ISO 639 2-character language code. |
string | null | $country_code | ISO 3166-1 Alpha-2 country code (optional) |
- Returns
- string The symbol for the specified currency, language, and country
Definition at line 63 of file CldrCurrencies.php.
References loadData().
◆ loadData()
static CldrCurrency::loadData |
( |
| $data | ) |
|
|
staticprivate |
◆ $cache
CldrCurrency::$cache = [] |
|
staticprivate |
The documentation for this class was generated from the following file: