问题
I've been at this the whole day. We have an intranet at the office, some PC's does not have internet access. I'm trying to get this website's RSS (http://news.bbc.co.uk/onthisday/)into a table with images and display it on the intranet, is this at all possible? Can someone please point me in the right direction?
回答1:
http://newsrss.bbc.co.uk/rss/on_this_day/front_page/rss.xml
There's your XML, just use SimpleXML to get your data from it. Very simple really.
Something to get you started:
$a = curl_init("http://newsrss.bbc.co.uk/rss/on_this_day/front_page/rss.xml");
curl_setopt($a, CURLOPT_RETURNTRANSFER,1);
$b = curl_exec($a);
$xml = simplexml_load_string($b);
var_dump($xml);
来源:https://stackoverflow.com/questions/10620048/display-rss-feed-item-on-intranet-via-php