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方法的代碼。