我从 Flickr 得到了正确的回复,即:
<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
<photoset id="72157630469695108" owner="15823425@N00" primary="5110549866" secret="fd716fb5ee" server="1136" farm="2" photos="101" count_views="67" count_comments="0" count_photos="101" count_videos="0" can_comment="0" date_create="1341701808" date_update="1345054078">
<title>Montana</title>
<description />
</photoset>
</rsp>
由于某种原因,我无法获得标题,我尝试了以下方法:
$album_info = simplexml_load_file($album_info_xml); // this is what the response is stored in
echo $album_info['photoset']['title'];
foreach($album_info->photoset as $ps) {
echo $ps['title'];
}
还有其他一些疯狂的事情,我知道这很愚蠢,但不知道我错过了什么。
可以在这里看到响应:http: //www.flickr.com/services/api/explore/flickr.photosets.getInfo
只需72157630469695108
用作集合 id 或使用此 url:http ://api.flickr.com/services/rest/?method=flickr.photosets.getInfo&api_key=7ccedd2c89ca10303394b8085541d9de&photoset_id=72157630469695108