'; $currency = array( "USD" => "", "EUR" => "", ); $convert = array( "isim" => "İsim", "forexbuying" => "Alış", "forexselling" => "Satış", ); $content = file_get_contents("http://www.tcmb.gov.tr/kurlar/today.xml"); foreach($currency as $code => $arr){ preg_match("'(.*)'Uis",$content,$crst); foreach($convert as $field => $value){ preg_match("'<".$field.">(.*)'Uis",$crst[2],$frst); $currency[$code][$value] = $frst[1]; } } $sen="
".print_r($currency,true)."
"; $sen1=str_replace('(','',$sen); $sen2=str_replace(')','',$sen1); $sen3=str_replace('Array','',$sen2); $sen4=str_replace('[USD] =>','',$sen3); $sen5=str_replace('[EUR] =>','',$sen4); $sen6=str_replace(' ','',$sen5); $sen7=str_replace('
','',$sen6);
$sen8=str_replace('
','',$sen7); $sen9=str_replace('[İsim]=>','',$sen8); $sen10=str_replace('AMERİKANDOLARI','USD',$sen9); $sen11=str_replace('[Alış]=>','Alış',$sen10); $sen12=str_replace('[Satış]=>','Satış',$sen11); $sen13=str_replace('EURO','EURO',$sen12); echo"
TCMB Döviz Kuru
$sen13"; echo"
TL
TL
TL
TL
"; ?>