1
我已经获得媒体ID列表。例如。如何从媒体ID获得instagram帖子的详细信息
$ media_id = 1147661250940270414_242644508
现在,我已经保存的介质ID。我现在想用Web服务立即获取其他详细信息。下面是我试过的,但没有运气。
$url = 'https://api.instagram.com/v1/media/'.$media_id.'?access_token='.$myaccess_token;
$response = file_get_contents($url);
$response = json_decode($response);
print_r($response);
Reference from instagram documentation。我怎么能调试? 注意:我已启用curl
。上面不打印任何东西。
同时打印$url
并浏览打印json数据。
是的,我也在寻找我出错的地方。即使在浏览器上打印url也会给我json数据 –
这就是结果。你想获得JSON数据,那么你必须使用你在PHP中的知识来分解它。 – Lachie
在解码json之前,'$ response = file_get_contents($ url);'什么也没有返回。 –