Home >Backend Development >PHP Tutorial >php json_encode Chinese does not transcode

php json_encode Chinese does not transcode

王林
王林Original
2019-10-09 17:40:4710166browse

php json_encode Chinese does not transcode

1. php json_encode Chinese does not transcode, and the following two conditions need to be met

php json_encode Chinese does not transcode

2. json_encode() sample code

php json_encode Chinese does not transcode

3. Save the above code and preview it in the browser

php json_encode Chinese does not transcode

4. Fill in the second one for json_encode() Parameter: JSON_UNESCAPED_UNICODE, which can realize Chinese non-transcoding

php json_encode Chinese does not transcode

5. Save the code again and view the encoded JSON format string in the browser. Chinese characters are displayed normally

php json_encode Chinese does not transcode

Recommended tutorial: PHP video tutorial

The above is the detailed content of php json_encode Chinese does not transcode. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn