PHP code example of slonyaka / market-rates
1. Go to this page and download the library: Download slonyaka/market-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/ */
slonyaka / market-rates example snippets
$rates = Slonyaka\Market\CurrencyRateFactory::make('alpha_vantage_api_key');
$ratesCollection = $rates->getRates('usd', 'eur', '5min');
foreach ($ratesCollection->read() as $rate) {
echo $rate->lowPrice;
}
while($item->next) {
echo $item->closePrice. "<br>";
$item = $item->next;
}