2011年8月23日火曜日

【PHP】RSS を読み込む content:encoded

simplexml_load_file でRSSを読み込んだ場合、

title
link
description

は、簡単に読む込むことができるが

content:encoded

を、同じ方法で読もうとしても、読むことができない。
しかし、下のようにすると、読むことができるようになる。

お試しあれ。

-------------------------

$fileName = "http://yajikita2han.cocolog-nifty.com/blog/index.rdf";
$xml = simplexml_load_file($fileName);
$db = $xml->item;

print $db[0]->title;
print $db[0]->link;
print $db[0]->children('http://purl.org/rss/1.0/modules/content/')->encoded;

0 件のコメント:

コメントを投稿