0
我想從定期更新它們的網站中提取特定貨幣的值。因爲我只需要將歐元兌換成少數外幣。這是可能的,或者我應該創建我自己的數據庫並更新它?從其他網站提取貨幣值
我想從定期更新它們的網站中提取特定貨幣的值。因爲我只需要將歐元兌換成少數外幣。這是可能的,或者我應該創建我自己的數據庫並更新它?從其他網站提取貨幣值
通過調用這個XML http://themoneyconverter.com/rss-feed/EUR/rss.xml
$url = "http://themoneyconverter.com/rss-feed/EUR/rss.xml";
$cont = file_get_contents($url);
$xml = new SimpleXMLElement($cont);
$feeds = "AED/EUR"; //// currency rate for United Arab Emirates Dirham
///// You can use it as session
foreach ($xml->channel->item as $xml2){
if ($xml2->title==$feeds){
$xml2->description."<br>";
preg_match('/([0-9]+\.[0-9]+)/', $xml2->description, $matches);
$rate = $matches[0];
}
}
我希望這將幫助你:)
謝謝你,我會看看這個 – FosAvance