easyx / php-currency
PHP Library for working with currency based on official rates of the Central Bank of the Russian Federation
Requires
- php: >=8.0
- ext-curl: *
- ext-json: *
- ext-simplexml: *
README
Library for working with currency based on the Central Bank of Russia exchange rate
⚠️ The library is designed to work with Laravel and PHP 8.0 and newer
Supported currencies
PHP Laravel Currency supports: RUB, AUD, AZN, GBP, AMD, BYN, BGN, BRL, HUF, VND, HKD, GEL, DKK, AED, USD, EUR, EGP, INR, IDR, KZT, CAD, QAR, KGS, CNY, MDL, NZD, NOK, PLN, RON, XDR, SGD, TJS, THB, TRY, TMT, UZS, UAH, CZK, SEK, CHF, RSD, ZAR, KRW, JPY.
Usage
Do currency manipulation in just few lines of code.
use EasyX\Currency; $currency = new Currency(100, 'RUB'); $amountUsd = $currency->convert('USD'); // 0.9341
Environment recommendations
PHP Laravel Currency takes information about the current exchange rate from the Central Bank of the Russian Federation. We strongly recommend setting up Cache if you have not done it before.
CACHE_DRIVER=redis # just not an array