RSS / XML解析删除<description>?</description>中的html标记

时间:2014-05-01 10:37:09

标签: php xml parsing rss simple-html-dom

我用简单的html dom解析这个rss网站。

但标记为<description>的结果,包含html标记。

<rss version="2.0">
<channel>
<description>
<br><table border=0 width= valign=top cellpadding=2
cellspacing=7><tr><td valign=top><a
href="http://news.google.com/news/url?sa=T&ct=us/0-0&fd=R&url=http://www.raleighchronicle.com/2006072105.html&cid=1108150860&ei=hUzBRO_JMpe2aInH 4PsB">Truck
Driver Wins $100,000 In Lottery; <b>NC</bPowerball
Winners</a><br><font size=-1><font color=#6f6f6f>Raleigh
Chronicle,&nbsp;NC&nbsp;-</font<nobr>2 hours
ago</nobr></font><br><font size=-1>REIDSVILLE -- According to the
<b>NC</bLottery Commission, when Dennis Mebane collected his prize
this week from a winning $100,000 instant scratch-off ticket, he
<b>...</b</font><br></table>
</description>
</channel>
</rss>

这是我的dom解析,我使用strip_tags但没有工作

$html = new simple_html_dom();
$html = file_get_html($data);
$content = $html->find('description',0)->plaintext;
echo strip_tags($content);

如何删除所有html标签?

之前感谢:)

0 个答案:

没有答案