How to solve the problem of garbled code of php get transmission parameters
What this article shares with you is about how to solve the problem of garbled php get transmission parameters. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
Php get transfer parameters garbled solutions: 1, open the corresponding PHP file; 2, through the "if ($tag = iconv ('UTF-8', $c, iconv ($c,' UTF-8', $tag) {.}" method to convert the code.
This article operating environment: Windows7 system, PHP7.1, Dell G3 computer.
How to solve the problem of garbled php get parameters?
An attempt to solve the problem of garbled codes of Chinese parameters in php get
The Chinese parameters of the website are sent directly, such as / index.php?t= Hello.
All pages are utf-8 encoded
Firefox, garbled code under normal IE under firefox
At present, this method is used to solve the problem temporarily.
$bm = array ('UTF-8','GBK'); $charTest; foreach ($bm as $c) {if ($tag = iconv (' UTF-8', $c, iconv ($c, 'UTF-8', $tag)) {/ / whether it is equivalent after transcoding $charTest = $c; break;}} if ($charTest = =' GBK') {$tag = iconv ('GBK',' UTF-8', $tag);}
The above is how to solve the problem of garbled php get transmission parameters, the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.