We know that with PHP Json_encode to deal with Chinese, Chinese will be encoded, become unreadable, similar to the "\u***" format, but also to some extent increase the amount of data transmitted.
<?php
Echo Json_encode ("Chinese");
"\u4e2d\u6587"
This let us do development in the celestial students, is very headache, sometimes also have to write their own json_encode.
In PHP5.4, the problem was finally resolved, and JSON added an option: Json_unescaped_unicode, hence the name incredible, which means that JSON does not encode UNICODE.
Look at the following example:
<?php
Echo Json_encode ("Chinese", Json_unescaped_unicode);
Chinese
What, is it a change that makes everyone happy? Oh, of course, JSON in 5.4 also joined: json_bigint_as_string, Json_pretty_print, json_unescaped_slashes and other options, if interested, you can see: Json_encode
However, it is also a reminder that PHP 5.4 is still in the development phase and that any new features may be adjusted or changed before the final release. If you have any suggestions, also welcome feedback to help us make PHP better.