stereoflo / cbr-currency
Installs: 21
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/stereoflo/cbr-currency
Requires
- php: ^7.4
- ext-simplexml: *
- symfony/http-client: ^5.3
This package is auto-updated.
Last update: 2025-09-24 04:01:45 UTC
README
Библиотека для получения данных о курсах валют.
Источник данных: Получение данных, используя XML
Минимальное требование PHP 7.4
Использование
<?php include 'vendor/autoload.php'; use Stereoflo\CbrCurrency\DailyCurrencies; use Stereoflo\CbrCurrency\HttpClient\SymfonyHttpClient; use Stereoflo\CbrCurrency\Parser\XmlParser; $rate = new DailyCurrencies(new SymfonyHttpClient(), new XmlParser()); $rate->withDate((new DateTime())->modify('-1 year')); $isOk = $rate->retrieve(); $item = $rate->get('usd'); print $item->getDate()->format('d.m.Y');