【发布时间】:2015-06-02 16:31:41
【问题描述】:
我是绘制 api/php 的初学者。我想获取针对 page_id 等的事件数据。当我将 url 粘贴到浏览器中时,它返回 json 数据,但是当我使用 curl 或 file_get_contents();方法它返回“Null”。发送请求和获得响应的正确方法是什么。这是我的基本代码,除此之外我没有使用任何类型的包含文件等。
$json_link = "https://graph.facebook.com/getwellgabby/events/attending/?fields=id,name,description,timezone,start_time,cover&access_token=206516302813755|lRnrKAiu3Z......&since=1356998400&until=1483228800";
file_get_contents($json_link);
$obj = json_decode($json, true, 512, JSON_BIGINT_AS_STRING);
var_dump($json);
结果:布尔值(假)
【问题讨论】: