定期的に更新する Web サイトから特定の通貨の値を取得したいと考えています。ユーロのみをいくつかの外貨に変換する必要があるためです。それは可能ですか、それとも独自のデータベースを作成して更新する必要がありますか?
1 に答える
2
この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];
}
}
これがお役に立てば幸いです:)
于 2013-05-18T15:22:16.547 に答える