我正在用SimpleXMLElement
PHP 导入 RSS 提要。我的标题和描述有问题。出于某种原因,我从中获取提要的网站将标题和描述放在<![CDATA[...]]>
:
<item>
<title><![CDATA[...title...]]></title>
<link>...url...</link>
<description><![CDATA[...title...]]></description>
<pubDate>...date...</pubDate>
<guid>...link...</guid>
</item>
当我var_dump()
对 SimpleXMLElement 执行操作时,我得到(对于这部分):
[2]=>
object(SimpleXMLElement)#5 (5) {
["title"]=>
object(SimpleXMLElement)#18 (0) {
}
["link"]=>
string(95) "...link..."
["description"]=>
object(SimpleXMLElement)#19 (0) {
}
["pubDate"]=>
string(31) "...date..."
["guid"]=>
string(48) "...link..."
}
如何获取值以 <![CDATA[...]]>
从提要中读取标题和描述?