A simple package for working with the pseudo API of the bestchage.ru
- Save memory by using generators
- PHP 7.4 or above
- ZIP extension
composer require korkoshko/bestchange-api
$bestChange = new BestChange();
$bestChange->setArchivePath(__DIR__); // If param is not set, a tmp directory is used
$bestChange->download(); // Downloading archive with data
foreach($bestChange->getInfo() as $info) { // The generator returns (https://www.php.net/manual/ru/language.generators.php)
var_dump($info);
}
// Or using sugar method
var_dump(
$bestChange->getArray(InfoMethod::class);
);
foreach ($bestChange->getExchangers() as $exchanger) {
var_dump($exchanger);
}