我試圖直接在我的外部magento網站上顯示我的WordPress的飼料。我正在使用feedburner來實現這個結果。到目前爲止,我已經能夠顯示博客標題&鏈接。爲了改善外觀,我還希望在標題旁顯示博客。從XML提取XML圖像
這裏是PHP代碼我使用解析XML飼料與鏈接
<?php $channel = new Zend_Feed_Rss('http://feeds.feedburner.com/golfoy/pxce'); ?>
<div class="block block-rss">
<div class="block-content">
<ol id="graybox-latest-news">
<?php foreach ($channel as $item): ?>
<li><a href="<?php echo $item->link; ?>"><?php echo $item->description; ?></a></li>
<?php endforeach; ?>
</ol>
</div>
</div>
下面提到顯示博客標題是爲單一的信息源項目的XML代碼。您可以在this URL
<item>
<title>The grey-haired major winners.</title>
<link>http://blog.golfoy.com/the-grey-haired-major-winners/</link>
<pubDate>Mon, 29 Aug 2016 08:24:53 +0000</pubDate>
<guid isPermaLink="false">http://blog.golfoy.com/?p=980</guid>
<description>
<![CDATA[<img width="300" height="169" src="http://blog.golfoy.com/wp-content/uploads/2016/08/17_Jack_Nicklaus_20130805165206236_2560_1706.vresize.1200.675.high_.43-300x169.jpg" />
You are never too old to hit the greens and play a round of golf. In the history of men’s major championships, no golfer older than 48 (and just one golfer older than 46) has won. Have a look at the list of oldest men to have won a major: 1.Ben Hogan: The legend won […]]]>
</description>
<content:encoded>
....
</content:encoded>
</item>
我試圖趕上整個img標籤,或只是「源」,這是一個信息源項目的描述標籤中找到完整的飼料。最佳做法是什麼?
可能的重複[如何從HTML中提取img src,title和alt使用php?](http://stackoverflow.com/questions/138313/how-to-extract-img-src-title-and-alt- from-html-using-php) – revo