2012-07-30 109 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方法。