Display RSS feed item on intranet via php

a 夏天 提交于 2019-12-13 06:50:35

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!