2012-07-30 81 views
0

上午抓取博客编码的标签信息使用的magpierss-0.72 RSS解析器现在我想从我的博客就像如何内容获取:从WordPress的RSS

<content:encoded><img src="path" /></content:encoded> 
获取图像,在标签内的图片我的网站

我的代码是我曾尝试是

require_once('rss_fetch.inc'); 
$rss = fetch_rss($url); 

foreach ($rss->items as $i => $item) { 
$title = strtoupper ($item['title']); 
$url = $item['link']; 
$date = $item['pubdate']; 
$desc = $item['description']; 
$content = $item['content:encoded']; 
echo $title."<br />"; 
echo $url."<br />"; 
echo $date."<br />"; 
echo $desc."<br />"; 
echo $content."<br />"; 
} 

但在内容细节:编码标记不取。任何一个可以帮我请

预先感谢您

+0

'$ item'包含...? – 2012-07-30 04:48:05

+0

我刚刚给它计算了博客的数量,以便在一些博客之后停止显示博客 – user1561923 2012-07-30 04:49:48

回答

0

应该被解析到$item['content']['encoded']领域,如果你的饲料是一个Atom feed或下$item['atom_content']如果你的饲料是一个RSS feed。

仅供参考,请参阅rss_parse.phpMagpieRSS::parse方法。