Copy the code The code is as follows:
echo json_encode("Chinese"); //"u4e2du6587"
Copy the code The code is as follows:
echo json_encode("中文", JSON_UNESCAPED_UNICODE); //"中文"
How about it, is it a change that makes everyone happy? Haha, of course, Json has also added: JSON_BIGINT_AS_STRING, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES and other options in 5.4. If you are interested, you can refer to: json_encode
However, I still have to remind you: 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, feedback is also welcome to help us make PHP better.
From: http://www.laruence.com
The above introduces the unicode character set to make Json understand Chinese JSON_UNESCAPED_UNICODE better, including the unicode character set. I hope it will be helpful to friends who are interested in PHP tutorials.