In many cases, we can see unicode-encoded text, such as u6d3bu52a8u63a5u53e3. Although the program will recognize it, it is inconvenient for human eyes to read it. Many people write many conversion functions on the Internet, however, the solution with a line of PHP code is: $ str {success: true, msg: u6d3bu52a8u6
Unicode-encoded text, such as \ u6d3b \ u52a8 \ u63a5 \ u53e3, can be seen in many occasions. Although the program knows it, it is inconvenient for the human eyes to read it, many people write a lot of conversion functions on the network, but one is more bloated, and finally found a solution with a line of PHP code: $ str = '{"success": true, "msg": "\ u6d3b \ u52a8 \ u6
In many cases, we can see unicode-encoded text, such as "\ u6d3b \ u52a8 \ u63a5 \ u53e3". Although the program will recognize it, it is inconvenient for human eyes to read it, many people write a lot of conversion functions on the network, but one is more bloated, and finally found a solution with a line of PHP code:
$ Str = '{"success": true, "msg": "\ u6d3b \ u52a8 \ u63a5 \ u53e3 "}'; echo $ str = preg_replace ("# \\\ u ([0-9a-f] +) # ie", "iconv ('ucs-2', 'utf-8 ', pack ('h4 ',' \ 1 ') ", $ str );
If the server is self-written, you can use the following methods to solve php5.4 or later:
Echo json_encode ("Chinese character", JSON_UNESCAPED_UNICODE );