We know that when json_encode of PHP is used to process Chinese characters, Chinese characters are encoded and become unreadable, similar to \ u *** format, it also increases the amount of data transmitted to a certain extent. echojson_encode (& quot; Chinese & quot;); // & quot; \ u4e2d \ u6587 & quot; This lets me... "> <LINK
We know that when PHP's json_encode is used to process Chinese characters, Chinese characters are encoded and become unreadable, similar to the "\ u ***" format, it also increases the amount of data transmitted to a certain extent.
Echo json_encode ("Chinese ");
// "\ U4e2d \ u6587"
This makes it a headache for those of us who develop in Tianchao. sometimes they have to write json_encode on their own.
In PHP5.4, this problem was finally solved. Json added a new option: JSON_UNESCAPED_UNICODE, so the name is Unicode, that is, Json does not encode Unicode.
See the following example:
Echo json_encode ("Chinese", JSON_UNESCAPED_UNICODE );
// "Chinese"
How are changes that make everyone happy? Well, of course, Json is added in 5.4: JSON_BIGINT_AS_STRING, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, etc. if you are interested, refer to: json_encode.
However, we still need to remind you that PHP 5.4 is still in the development stage. before the final release, any new features may be adjusted or changed. if you have any suggestions, please feel free to give us feedback and help us make PHP better.