PHP code example of rustem-kaimolla / kz-currency-rates
1. Go to this page and download the library: Download rustem-kaimolla/kz-currency-rates library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rustem-kaimolla / kz-currency-rates example snippets
use Currency\Requests\RateRequestBuilder;
use Currency\Parsers\XmlRateParser;
use Currency\Services\RateFetcher;
use GuzzleHttp\Client;
$builder = (new RateRequestBuilder())->forDate('12.05.2025');
$parser = new XmlRateParser();
$fetcher = new RateFetcher(
$builder->build(),
$parser
);
$rates = $fetcher->getAllRates();
foreach ($rates as $rate) {
echo $rate->code . ': ' . $rate->rate . PHP_EOL;
}