Home > Backend Development > PHP Tutorial > Solution to Chinese garbled POST in IE browser - PHP implementation

Solution to Chinese garbled POST in IE browser - PHP implementation

WBOY
Release: 2016-07-29 09:08:46
Original
1580 people have browsed it

Under the IE browser, the POST data contains Chinese characters, which will become garbled after being obtained in the background. The solution is as follows:

$keys  = $_REQUEST['keys'];


if ($keys != '') {
    $encode = mb_detect_encoding ($keys, array("ASCII", "UTF-8", "GB2312", "GBK", "BIG5"));
    if ($encode != "UTF-8") {
        $keys = iconv ("gb2312", "UTF-8", $keys);
    }
}
Copy after login

Reference: http://blog.sina.com.cn/s/blog_703bcf7c0100s6vb. html

The above introduces the solution to the Chinese garbled POST under IE browser - PHP implementation, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template