ini_set('display_errors', 0); function tcmb($bakilacak,$site){ $dosya = @fopen($site, "r"); if ($dosya) { $geldi = false; while(!feof($dosya)) { $satir = fgets($dosya,512); $code = substr($satir, 0, 3); if (($code == $bakilacak) && ($geldi == false)) { $geldi = true; $sonuc = split("[[:space:]]+" , $satir); $doviz[1] = substr($sonuc[4], 0, 9); $doviz[2] = substr($sonuc[5], 0, 9); $doviz[3] = substr($sonuc[6], 0, 9); $doviz[4] = substr($sonuc[7], 0, 9); } } // while return $doviz; } // if($dosya) }// function $usd_doviz = tcmb('USD','http://www.tcmb.gov.tr/kurlar/today.html'); $eur_doviz = tcmb('EUR','http://www.tcmb.gov.tr/kurlar/today.html'); $gbp_doviz = tcmb('GBP','http://www.tcmb.gov.tr/kurlar/today.html'); ?>
Alış : | Satış : | Alış : | Satış : |