Home>Article>Backend Development> What to do if Chinese characters are garbled when submitted in php from form
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".
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 TutorialThe 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!