【发布时间】:2009-12-16 04:14:14
【问题描述】:
xml:
<entry>
<link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://picasaweb.google.com/data/feed/api/user/xy/albumid/531885671007533108" />
<link rel="alternate" type="text/html" href="http://picasaweb.google.com/xy/Cooking" />
<link rel="self" type="application/atom+xml" href="http://picasaweb.google.com/data/entry/api/user/xy/albumid/531885671007533108" />
</entry>
这是我尝试过的:
foreach($xml->entry as $feed) {
$album_url = $feed->xpath("./link[@rel='alternate']/@href");
echo $album_url;
}
我也尝试过各种排列方式,但都没有成功。
预期结果为http://picasaweb.google.com/xy/Cooking
我得到的结果是“”。有人可以解释我做错了什么吗?
有人可以帮帮我吗?我已经在这里呆了好几个小时了……
【问题讨论】: