0
我想用PHP解析this feed。这是饲料结构:RSS源不会返回任何与PHP?
<item>
<title> ... TITLE ... </title>
<link> ... LINK .... </link>
<comments> .. COMMENTS .. </comments>
.... More tags here ....
<description><![CDATA[.. HTML ...]]></description>
</item>
这是我的PHP代码:
$rss = new DOMDocument();
$rss->loadHTML($feed_url);
foreach ($rss->getElementsByTagName('item') as $node) {
$description = $node->getElementsByTagName('description')->item(0)->nodeValue;
echo $description;
}
但它呼应什么。我试过使用cURL,但即使如此,我也无法回应description
标签。
我需要在此代码中更改它以使其工作?请让我知道如果我需要发布备用cURL方法的代码。