In the use of Json_decode JSON format string decoding is empty, page blank Ah, the whole half-day check here to check there, ask colleagues are useless.
Bing search today, the problem solved, originally there is a BOM head output, prawn solution is as follows:
1), Json_decode ($json, Boolean): $json is a JSON-formatted character, the second parameter is true when the conversion is an array, and the default false indicates
Convert to an object.
2), Json_decode Required string comparison is strict:
(1) Using UTF-8 encoding
(2) cannot have a comma at the last element
(3) cannot use single quotation marks
(4) cannot have \r,\t, if please replace
Solution One:
So here's the problem. Returns the invisible character of the BOM header in the returned JSON string, some editors default to the BOM header, and the following processing is required to correctly parse the JSON data:
<?php
$info = Json_decode (Trim ($info, Chr (239). chr (187). Chr (191)), true);
Method Two: Transcode the Chinese before converting to JSON
Reprint Address: http://www.cnblogs.com/anns/p/5974143.html
Reprint Address: https://segmentfault.com/q/1010000002991973
PHP get JSON json_decode return null workaround