我正在尝试使用 simplexml_load_file 从 XML 提要中提取数据。这就是我现在所拥有的:
<?php
$anobii = simplexml_load_file('http://www.anobii.com/rss_shelf?s=01fe251a6c442bbf8a');
foreach ($anobii->entry as $anobiiinfo):
$title=$anobiiinfo->rss->channel->item->title;
$desc=$anobiiinfo->rss->channel->item->description;
echo "<span> ",$title,"</span><br><span> ",$desc,"</span>";
endforeach;
?>
问题是我不知道正确的分隔符来告诉脚本它需要提取的部分(rss->channel->item->title
)。