Php's json_encode question: php's json_encode will convert the Chinese characters in the array into strings similar to \ u821c. Is there any way not to convert them? Or reverse, but still in json format.
Reply to discussion (solution)
You use js to read Chinese characters.
I know that js reads Chinese characters, but the answer I need is not what you said, but what I asked, and I didn't say that I used js to read it...
Php 5.4 and later, the second parameter JSON_UNESCAPED_UNICODE can be added
Or simply
$ A = array ('charset' => 'China'); array_walk_recursive ($ a, function (& $ v) {$ v = urlencode ($ v );}); echo urldecode (json_encode ($ ));{"Charset": "Chinese "}
Do not worry about UTF-8 connection.
Reference: http://blog.csdn.net/fdipzone/article/details/28766357
Php 5.4 and later, the second parameter JSON_UNESCAPED_UNICODE can be added
Or simply
$ A = array ('charset' => 'China'); array_walk_recursive ($ a, function (& $ v) {$ v = urlencode ($ v );}); echo urldecode (json_encode ($ ));{"Charset": "Chinese "}
Do not worry about UTF-8 connection.
I didn't write the second parameter in the php5.4 chm Manual. it looks like I have to update the manual...