I just find sometimes jsonResult.php can’t return json result correctly, but nothing.(html and xml results work perfectly)
For example: The path is jsonResult.php?test=151229_ZR_Z4
in jsonResult.php file, I can see:
I var_dump($ret) and get a large array, but json_response($ret) returns nothing.
I guess it’s because the size of my array is too big, and json_encode can’t accept the large array.
Maybe it’s a bug, is there a quick solution to solve it?
Is this for a private instance of WPT? If so, check your error logs.
Hi, thanks for reply. yes, it’s a private instance.
it’s a good idea. but there is nothing in the error log.
I added json_last_error() in the jsonResult.php, and got the output is 5, which is JSON_ERROR_UTF8
After I utf8_encode the array, json_response finally output the json.
Some non-UTF8 items in there some where then? May be worth tracking down the source of that.
oh, sorry, I forget to add some words at the first: json_response doesn’t always return nothing, just seldom.
At beginning, I thought there are some special characters in the array items. But, I use mb_detect_encoding and find almost all the items in the array are in ASCII
Sun, 27 Dec 2015 07:33:00 +0000
all of them are in ASCII