alexanderc/exchange-rates

This package is abandoned and no longer maintained. No replacement package was suggested.

Library that parses exchange rates of different countries using different providers

v1.1.1 2015-04-10 09:16 UTC

This package is not auto-updated.

Last update: 2020-10-20 13:07:55 UTC


README

Library that parses exchange rates of different countries using different providers

##Reuirements## See composer.json

##Installation##

  • Install Composer
  • Add in your composer.json under require section: "alexanderc/exchange-rates": "dev-master"
  • Run composer.phar install or composer.phar update

##Available Providers##

##Basic Usage##

require 'vendor/autoload.php';

use ExchangeRates\Client;

$client = Client::create('curs_md');

foreach($client->parse(new \DateTime()) as $rate) {
    echo sprintf(
        "%s (%s), %s: %s=%.2f%s\n",
        $rate->getCountry(),
        $rate->getBank(),
        $rate->getHumanizedType(),
        $rate->getMainCurrency(),
        $rate->getExchangeRate(),
        $rate->getLocalCurrency()
    );
}

Check https://github.com/AlexanderC/ExchangeRates/blob/master/tests/basic.php for more examples

##TODO##

  • Unit tests
  • Add more providers

##License##

  • Apache v2.0

##Sponsors##