這是我所擁有的。
` $ users = array();
foreach($rsp->photos->photo as $photo)
{
$photo_owner = $photo["owner"];
$photo_id = $photo['id'];
$photo_title = $photo['title'];
$photo_url = "http://flickr.com/photos/" . $photo_owner . "/" . $photo_id . "/";
$flickr_getSizes = "http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key=$api_key&photo_id=$photo_id";
// If its not in an array, add it and output the image
if (!in_array($photo_owner, $users)){
array_push($users, $photo_owner);
$flickr_getSizes = "http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key=$api_key&photo_id=$photo_id";
$sizes_rsp = getXML($flickr_getSizes);
foreach($sizes_rsp->sizes->size as $size){
if ($size['label'] == $preferredSize) {
echo '<li>';
echo '<a href="' . $photo_url . '"><img src="' . $size['source'] .'"/></a>';
echo '<h3><a href="' . $photo_url . '">' . $p_title . '</a></h3>';
echo '</li>';
}
}
}
}`
上面還有更多,但它只獲取XML。
有人嗎?這是相當緊迫的 –
嗨!你有沒有找到這個問題的答案? –