Home>Article>Backend Development> What to do if php request is garbled
Solution to garbled php request: First open the corresponding code file; then change the encoding through the "mb_convert_encoding($_GET['v'], "UTF-8", "gb2312");" statement .
Recommendation: "PHP Video Tutorial"
Specific questions:
php request Chinese characters are garbled
There is a form submitted to a.php
../a.php?v=China
The printed result , is China garbled? How to solve it?
The encoding of the document is charset=gb2312
My server is a US server, mainly UTF-8
Solution:
Code such as:
$str = mb_convert_encoding($_GET['v'], "UTF-8", "gb2312");
The above is the detailed content of What to do if php request is garbled. For more information, please follow other related articles on the PHP Chinese website!