Home  >  Article  >  Backend Development  >  Garbled characters appear in the php form jump box

Garbled characters appear in the php form jump box

angryTom
angryTomOriginal
2019-10-31 14:45:182803browse

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

Garbled characters appear in the php form jump boxHere 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!

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