Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/259.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用php middlecoin.com解析JSON API调用_Php_Arrays_Json_Api_Object - Fatal编程技术网

使用php middlecoin.com解析JSON API调用

使用php middlecoin.com解析JSON API调用,php,arrays,json,api,object,Php,Arrays,Json,Api,Object,我试图从middlecoin.com API中获取统计数据。它返回一个JSON响应,我加载了以下代码: $site = 'http://www.middlecoin.com/json'; $data = do_curl($site); $json = json_encode(utf8_encode($data)); $results = utf8_decode(json_decode($json)); do_curl函数执行它在tin上所说的操作 当我打印($results)时,我会得

我试图从middlecoin.com API中获取统计数据。它返回一个JSON响应,我加载了以下代码:

$site = 'http://www.middlecoin.com/json';    
$data = do_curl($site);
$json = json_encode(utf8_encode($data));
$results = utf8_decode(json_decode($json));
do_curl函数执行它在tin上所说的操作

当我打印($results)时,我会得到以下输出(由于标准响应超过3MB,所以会有所减少)

这就是问题开始的地方,因为我无法对响应做任何事情。我尝试将其加载到中,并使用其中的示例来响应以下结果:

echo $data->report[0][0];
但无论我如何尝试读取数据,都不会有任何结果(除了偶尔出现的卷曲括号?)


感谢您的帮助。

经过大量的故障排除,我发现了问题。提高内存限制解决了该问题

ini_set('memory_limit','16M');
ini_set('memory_limit','16M');