0
錯誤我使用這個API顯示在Flickr的API
<?php
require_once("phpFlickr.php");
$f = new phpFlickr("$api_key");
$api_key = "my api key";
$api_secret = "my api secret";
$recent = $f->photos_getRecent();
print_r($recent);
foreach ($recent['photo'] as $photo) {
$owner = $f->people_getInfo($photo['owner']);
echo "<a href='http://www.flickr.com/photos/" . $photo['owner'] . "/" . $photo['id'] . "/'>";
echo $photo['title'];
echo "</a> Owner: ";
echo "<a href='http://www.flickr.com/people/" . $photo['owner'] . "/'>";
echo $owner['username'];
echo "</a><br>";
}
?>
,但它給錯誤
Warning: Invalid argument supplied for foreach() in /home/content/27/9937227/html/project/ww/example.php on line 23
可能是什麼問題?
你的問題是什麼? –
嗨,我的問題是我使用此api,但顯示此錯誤: 警告:無效參數爲foreach()提供的/home/content/27/9937227/html/project/ww/example.php在線23 – user3060459
添加錯誤在你的問題。並添加$ recent的內容 –