Home > Article > Backend Development > Garbled characters appear in the php form jump box
The php form jump box appears with garbled characters
What should I do if the JS pop-up box written in php appears with garbled characters? What's the solution?
1. First, find the encoding format in your editor. Set to utf-8 format, most encodings now use this. Of course, there are also GB2312
Here is SublimeText as an example.
2. Then, add
header("Content-Type: text/html;charset=gb2312");
or
header("Content-Type: text/html;charset=utf-8");
at the top of php. For more PHP related knowledge, please visit PHP Chinese website!
The above is the detailed content of Garbled characters appear in the php form jump box. For more information, please follow other related articles on the PHP Chinese website!