HAZIRKODLAR

Script Adý : PHP ile Döviz Kuru Alma
Telif : bbokeer
Kategori : Php
Hit : 2230

function CropSt($st, $what, $len=100) {
$start = strpos( $st, $what );
$st = substr( $st, $start+strlen($what), $len );
return $st;
}
function GetRoE($st, $endsep = " TL") {
$end = strpos( $st, $endsep);
$st = substr( $st, 0, $end);
$st = ereg_replace( ",", "", $st );
return (int)$st;
}
function SaveStringToFile($filename, $text) {
$file = @fopen($filename, "w");
if ( $file ) {
fputs($file, $text);
fclose($file);
}
}
// VillaDöviz
$vd = @file( "http://www.villadoviz.com/" );
if ( $vd ) {
$vd = implode("", $vd);
$vd = CropSt( $vd, "USD", 90);
$vd = CropSt( $vd, "Alýþ ");
$alis = GetRoE($vd);
$vd = trim(CropSt($vd, "Satýþ " ));
$satis = GetRoE($vd);
}
// T.C. Merkez Bankasý
$tcmb_today = @file("http://www.tcmb.gov.tr/kurlar/today.html");
if ( $tcmb_today ) {
$tcmb_today = implode("", $tcmb_today);
$tcm_today = ereg_replace("\r", "", $tcmb_today);
$start = strpos($tcmb_today, "ABD DOLARI");
$tcmb_today = trim(substr($tcmb_today, $start+14, 70));
while ( ereg( "[ ]{2,}", $tcmb_today)>0 )
$tcmb_today = ereg_replace( "[ ]{2,}", " ", $tcmb_today );
/* while ( strpos($tcmb_today, " ")>0 )
$tcmb_today = ereg_replace(" ", " ", $tcmb_today); */
$tcmb_today = explode( " ", $tcmb_today );
$doviz_alis = (int)ereg_replace( ",", "", $tcmb_today[0] );
$doviz_satis = (int)ereg_replace( ",", "", $tcmb_today[1] );
$efektif_alis = (int)ereg_replace( ",", "", $tcmb_today[2] );
$efektif_satis = (int)ereg_replace( ",", "", $tcmb_today[3] );
}
// Yatýrýmcý Köþesi - Superonline
$yatirimci = @file("http://www.borsadan.com/doviz.asp");
if ( $yatirimci ) {
$yatirimci = implode("", $yatirimci);
$yatirimci = CropSt( $yatirimci, 'ABD Dolarý', 300);
SaveStringToFile("sol.txt", "SOL\n\n".$yatirimci);
$yatirimci = strip_tags($yatirimci);
$yatirimci = ereg_replace( ",", "", trim($yatirimci) );
$yatirimci = ereg_replace( "\t|\n|\r", " ", $yatirimci );
while ( ereg( "[ ]{2,}", $yatirimci)>0 )
$yatirimci = ereg_replace( "[ ]{2,}", " ", $yatirimci );
$yatirimci = explode( " ", $yatirimci );
$y_alis = (int)$yatirimci[0];
$y_satis = (int)$yatirimci[1];
$y_endusuk = (int)$yatirimci[2];
$y_enyuksek = (int)$yatirimci[3];
$y_saat = $yatirimci[4];
}
// KOÇ Bank
$koc = @file("http://www.kocbank.com.tr/_index/index_main.asp");
if ( $koc ) {
$koc = implode("", $koc);
$koc = CropSt( $koc, ' USD:', 265);
$koc = CropSt( $koc, '',151);
$koc = strip_tags($koc);
$koc = ereg_replace( "\.", "", trim($koc) );
$koc = ereg_replace( "\t|\n|\r", " ", $koc );
while ( ereg( "[ ]{2,}", $koc)>0 )
$koc = ereg_replace( "[ ]{2,}", " ", $koc );
$koc = explode( " ", $koc );
$koc_alis = (int)$koc[0];
$koc_satis = (int)$koc[1];
} else
echo "HATA";
?>
/*
******************* ÖRNEK SAYFA *************************

*/
?>









if ( $vd ) {
?>














}
if ( $tcmb_today ) {
?>






















}
if ( $yatirimci ) {
?>



















}
if ( $koc ) {
?>











}
?>
VillaDöviz
$USD Alýþ TL
$USD Satýþ TL

MerkezBankasý
Döviz Alýþ TL
Döviz Satýþ TL
Efektif Alýþ TL
Efektif Satýþ TL

YatýrýmcýK öþesi - Superonline ()
Döviz Alýþ TL
Döviz Satýþ TL
En Düþük TL
En Yüksek TL
KoçBankasý
Döviz Alýþ TL
Döviz Satýþ TL







alıntıdır

Beğeniler: 0
Favoriler: 0
İzlenmeler: 565
favori
like
share