Home  >  Article  >  Backend Development  >  What to do if Chinese characters are garbled when submitted in php from form

What to do if Chinese characters are garbled when submitted in php from form

藏色散人
藏色散人Original
2021-09-17 09:55:482150browse

Solution to garbled Chinese characters submitted from form php: 1. Add "charset=UTF-8" to the head in HTML; 2. Change all files to utf8 encoding; 3. Add "charset=UTF-8" to php charset=UTF-8".

What to do if Chinese characters are garbled when submitted in php from form

The operating environment of this article: Windows7 system, PHP7.1 version, Dell G3 computer

What to do if php from form submission Chinese characters are garbled ?

php The solution to the problem of Chinese garbled characters when submitting form submission to php is as follows:

1. Add

2. Make sure all files are utf8 encoded

3. Add header("Content-Type:text/html; charset=UTF-8");

in php to solve the problem.

Recommended learning: "

PHP Video Tutorial

"

The above is the detailed content of What to do if Chinese characters are garbled when submitted in php from form. 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