文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Zend Framework之feed实例

Zend Framework之feed实例

时间:2008-01-09  来源:panzt

require_once 'Zend/Feed.php';
// 取得最新的 Slashdot 头条新闻
try {
    $slashdotRss = Zend_Feed::import('http://rss.slashdot.org/Slashdot/slashdot');
} catch (Zend_Feed_Exception $e) {
    // feed 导入失败
    echo "Exception caught importing feed: {$e->getMessage()}\n";
    exit;
}
// 初始化保存 channel 数据的数组
$channel = array(
    'title'       => $slashdotRss->title(),
    'link'        => $slashdotRss->link(),
    'description' => $slashdotRss->description(),
    'items'       => array()
    );
// 循环获得channel的item并存储到相关数组中
foreach ($slashdotRss as $item) {
    $channel['items'][] = array(
        'title'       => $item->title(),
        'link'        => $item->link(),
        'description' => $item->description()
        );
}
?>


相关阅读 更多 +
排行榜 更多 +
方块枪战战场安卓版

方块枪战战场安卓版

飞行射击 下载
战斗火力射击安卓版

战斗火力射击安卓版

飞行射击 下载
空中防御战安卓版

空中防御战安卓版

飞行射击 下载