tomwright / currency-php-fixerio-rate-fetcher
An extension to fetch exchange rates from the FixerIO API.
Fund package maintenance!
TomWright
www.buymeacoffee.com/TomWright
Requires
- phpunit/phpunit: *
- tomwright/currency-php: ^0.0.3
This package is auto-updated.
Last update: 2024-11-15 07:35:22 UTC
README
Installation
Install CurrencyPHP.
composer require tomwright/currency-php
composer require tomwright/currency-php-fixerio-rate-fetcher
Usage
FixerIORateFetcher is just a RateFetcher for CurrencyPHP.
$rateFetcher = new FixerIORateFetcher(); $gbp = new Currency('GBP', $rateFetcher); $usd = new Currency('USD', $rateFetcher); $priceInGBP = 100; $priceInUSD = $gbp->convertTo($usd, $priceInGBP); echo $priceInUSD; // 126