DOM hatası! http://www.tcmb.gov.tr/kurlar/today.xml çalışmıyor.
Helper Fonksiyonum aşşağıda ki gibidir.
Çözümü Bilen duyan var mı ?
<?php
function USDtoTRY($cost){
$oneYear = 60*60*24*365;
$urls = array();
$SiteMapURL = "http://www.tcmb.gov.tr/kurlar/today.xml";
$DomDocument = new DOMDocument();
$DomDocument->preserveWhiteSpace = false;
$DomDocument->load($SiteMapURL);
$DomNodeList = $DomDocument->getElementsByTagName('Isim');
$DomNodeForexBuying = $DomDocument->getElementsByTagName('ForexBuying');
$DomNodeForexSelling = $DomDocument->getElementsByTagName('ForexSelling');
foreach($DomNodeList as $url) {
$urls[] = $url->nodeValue;
}
foreach($DomNodeForexBuying as $buying) {
$usd1[] = $buying->nodeValue;
}
foreach($DomNodeForexSelling as $selling) {
$usd2[] = $selling->nodeValue;
}
$try = $usd2[0] * $cost;
return $try;
}
?>
Hata Çıktısı ise