-1
我想获得一个RSS feed的标题和链接 -解析reddit的RSS源 - PHP
https://www.reddit.com/r/gif.rss
(在reddit的饲料)
xml=simplexml_load_file("https://www.reddit.com/r/gif.rss") or die("Error: Cannot create object");
foreach ($xml->entry->content as $x) {
$title = $x->title;
$string = $x->link;
echo $title;
echo "<br>";
echo $string;
}
我不能让标题或链接出现。
我没有看到任何回音声明 –
我试图呼应标题和字符串 - 什么发生 –
'$ x'是一个字符串对象,您可以回显。你必须从'$ x'解析html。 – aynber