Home >Backend Development >PHP Tutorial >Analysis of Chinese garbled characters in PHP pages_PHP tutorial
There are several reasons why Chinese garbled characters appear on PHP pages. One is that the page encoding is not counted. The second is that the encoding is not set in the database. The third is that there is a problem with the apache encoding. Let me introduce two solutions to you. Overall It means that the page encoding is not uniform.
Garbled characters are mostly caused by inconsistencies in encoding methods. There are four main inconsistencies that may cause this possibility:
1. Encoding method of page files (.html, .php, etc.)
2. The encoding method of the browser specified in html.head
3. The encoding method of MySql database transmission
4. Apache character set
On a page with only PHP code, when creating a JS pop-up window, if the content of the pop-up window contains Chinese characters, garbled characters may occur.
The solution is a line of code:
Chinese garbled characters on the page