Home >Backend Development >PHP Problem >What to do if the php pop-up box is garbled

What to do if the php pop-up box is garbled

藏色散人
藏色散人Original
2020-08-18 10:16:042564browse

The solution to the garbled pop-up box in php: first find the encoding format in the editor; then add the code statement at the top of php as "header("Content-Type: text/html;charset=utf-8" );" and save it.

What to do if the php pop-up box is garbled

Recommendation: "PHP Video Tutorial"

Why garbled characters appear in the php pop-up box

Solution to the garbled code in the JS pop-up box written in php:

First, find the encoding format in your editor. Set to utf-8 format, most encodings now use this. Of course, there is also GB2312/

Then,

At the top of php, add

header("Content-Type: text/html;charset=gb2312");

or

header("Content-Type: text/html;charset=utf-8");

The above is the detailed content of What to do if the php pop-up box is garbled. 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