1. Go to this page and download the library: Download teknomavi/tcmb 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/ */
teknomavi / tcmb example snippets
composer
use Teknomavi\Tcmb\Doviz;
$doviz = new Doviz();
echo " USD Alış:" . $doviz->kurAlis("USD");
echo " USD Satış:" . $doviz->kurSatis("USD");
echo " EURO Efektif Alış:" . $doviz->kurAlis("EUR", Doviz::TYPE_EFEKTIFALIS);
echo " EURO Efektif Satış:" . $doviz->kurSatis("EUR", Doviz::TYPE_EFEKTIFSATIS);
use Teknomavi\Tcmb\Doviz;
// Doctrine Memcache Init
$memcache = new Memcache();
$memcache->connect('localhost', 11211);
$cacheDriver = new \Doctrine\Common\Cache\MemcacheCache();
$cacheDriver->setMemcache($memcache);
// Doviz Kütüphanesi
$doviz = new Doviz($cacheDriver);
echo " USD Alış:" . $doviz->kurAlis("USD");
echo " USD Satış:" . $doviz->kurSatis("USD");
echo " EURO Efektif Alış:" . $doviz->kurAlis("EUR", Doviz::TYPE_EFEKTIFALIS);
echo " EURO Efektif Satış:" . $doviz->kurSatis("EUR", Doviz::TYPE_EFEKTIFSATIS);