【发布时间】:2015-06-12 06:58:53
【问题描述】:
我使用json_encode($response) 列出了目录中的所有文件。由于$response的数组中有近8000条记录,所以在页面中显示时返回null。
我对这个问题进行了研究。到目前为止,我找不到任何解决方案。
这是我的代码:
$response['content'] = Files::$output;
echo json_encode($response);
Files::$output` /* this will return the list of files in the html format. */
当我尝试echo json_last_error_msg(); 时,它返回:
格式错误的 UTF-8 字符,可能编码不正确
【问题讨论】:
-
你是如何在页面上显示的,你能发布你的代码吗?
-
你尝试过更改php.ini中的memory_limit参数吗?
-
在我的 php.ini 中我设置了内存限制 128M
-
您如何得出结论认为问题在于输入的 size 而不是其他问题?你检查过
json_last_error_msg吗? -
所以你的问题原来是stackoverflow.com/questions/14868096/…的重复