Download the PHP package fallenangelbg/bgncurrencytool without Composer
On this page you can find all versions of the php package fallenangelbg/bgncurrencytool. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fallenangelbg/bgncurrencytool
More information about fallenangelbg/bgncurrencytool
Files in fallenangelbg/bgncurrencytool
Package bgncurrencytool
Short Description Currency convertor through Bulgarian Lev, using BNB official courses
License MIT
Informations about the package bgncurrencytool
Currency tool for Bulgarian Lev
This tool can convert sums to Bulgarian Lev. The courses are read from the Bulgarian National Bank site. It also can return an array with conversions for a list of currencies.
Usage
As a single converter
Convert 100 000 US Dollars to Bulgarian Lev
Result:
As a mass converter
Result:
External read
The tool read a predefined XML file from the site of the Bulgarian National Bank.
The reader only works like this:
Its good to do this via a cron job. Here's an example of SQL table to have the results saved:
Later, you can do a read to this table to get an array similar to this one:
or you can use some cache do read it once a day - Memcached, REDIS, etc. It's important to keep the array in the given format.
Example
In example folder you can find the mentioned examples.
List of currencies
The list of currencies, supported by this tool (and Bulgarian National Bank)
| Currency | CODE | Quantity |
|---|---|---|
| Australian Dollar | AUD | 1 |
| Brazilian Real | BRL | 10 |
| Canadian Dollar | CAD | 1 |
| Swiss Franc | CHF | 1 |
| Chinese Yuan Renminbi | CNY | 10 |
| Czech Koruna | CZK | 100 |
| Danish Krone | DKK | 10 |
| British Pound | GBP | 1 |
| Hong Kong Dollar | HKD | 10 |
| Croatian Kuna | HRK | 10 |
| Hungarian Forint | HUF | 1000 |
| Indonesian Rupiah | IDR | 10000 |
| New Israel Shekel | ILS | 10 |
| Indian Rupee | INR | 100 |
| Icelandic Krona | ISK | 100 |
| Japanese Yen | JPY | 100 |
| South Korean Won | KRW | 1000 |
| Mexican Peso | MXN | 100 |
| Malaysian Ringgit | MYR | 10 |
| Norwegian Krone | NOK | 10 |
| New Zealand Dollar | NZD | 1 |
| Philippine Peso | PHP | 100 |
| Polish Zloty | PLN | 10 |
| Romanian Leu | RON | 10 |
| Russian Rouble | RUB | * |
| Swedish Krona | SEK | 10 |
| Singaporean Dollar | SGD | 1 |
| Thai Baht | THB | 100 |
| Turkish Lira | TRY | 10 |
| US Dollar | USD | 1 |
| South African Rand | ZAR | 10 |
Russian Ruble is not used at the moment due to the political situation.
All versions of bgncurrencytool with dependencies
ext-curl Version *
ext-json Version *
ext-libxml Version *
ext-simplexml Version *