PHP Class ExchangeRatesCBRF
Requirements
- PHP 5 or greater
- SOAP and SimpleXML
Installation
Install via Composer, (*1)
composer require thalidzhokov/exchange-rates-cbrf
OR include ExchangeRatesCBRF.php in your PHP code, (*2)
require_once("ExchangeRatesCBRF.php");
Usage
Examples of using ExchangeRatesCBRF Class to get exchange rates of the Central Bank of Russia, (*3)
Example 1 \
Get exchange rate of Ukrainian Hryvnia (Alphabetic currency code - UAH) on 25.05.2015, (*4)
$rates = new ExchangeRatesCBRF("2015-05-25");
echo $rates->GetRate("UAH");
Example 2 \
Get cross-rate of the US Dollar to Euro on 26.06.2015, (*5)
$rates = new ExchangeRatesCBRF("2015-06-26");
echo $rates->GetCrossRate("EUR", "USD");
Example 3 \
Get exchange rates of the Central Bank of Russia on 27.07.2015, (*6)
$rates = new ExchangeRatesCBRF("2015-07-27");
echo $rates->GetRates();