Copy the Code code as follows:
Echo Json_encode ("Chinese"); "\u4e2d\u6587"
This let us do in the celestial development of the classmate, is a headache, and sometimes have to write their own json_encode.
In PHP5.4, the problem is finally resolved, JSON added an option: Json_unescaped_unicode, so the name Incredibles, that is, JSON do not encode UNICODE.
Look at the following example:
Copy the Code code as follows:
Echo Json_encode ("Chinese", Json_unescaped_unicode); Chinese
How, is not let everybody very happy change? Hehe, 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 still a reminder that PHP 5.4 is still in development, and any new features may be adjusted or changed before final release. If you have any suggestions, please also welcome feedback, help us make PHP better.
From: http://www.laruence.com
The above describes the Unicode character set to allow JSON to understand Chinese json_unescaped_unicode, including the Unicode character set content, I hope the PHP tutorial interested in a friend helpful.