PHP开发实例大全(提高卷) 中文完整pdf扫描版[244MB]
header( 'Content-Type: text/html; charset=utf-8' ); error_reporting(E_ALL); ini_set('display_errors', true); include './Rss.php'; // include library $Rss = new Rss; // create object /* XML way */ try { $feed = $Rss->getFeed('http://news.baidu.com/n?cmd=1&class;=internet&tn;=rss', Rss::XML); foreach($feed as $item) { echo "$item[title]\n"; //echo "".date('Y-m-d', strtotime($item['date']))."\n"; // echo "Category: $item[category]\n"; // echo "\n$item[description]\n"; } } catch (Exception $e) { echo $e->getMessage(); }
转载请注明:谷谷点程序 » php读取rss xml 百度新闻的源码下载