Home  >  Article  >  Backend Development  >  How to solve the Chinese garbled problem of php get

How to solve the Chinese garbled problem of php get

藏色散人
藏色散人Original
2020-11-23 09:52:172383browse

php get Chinese garbled code solution: 1. Solve garbled code through "iconv("gb2312","utf-8",$str);" method; 2. Use "mb_convert_encoding($str, "utf -8", "gb2312");" method to solve the garbled code.

How to solve the Chinese garbled problem of php get

Recommended: "PHP Video Tutorial"

  • This method is suitable for all brands computer.

The reasons and solutions for PHP receiving garbled Chinese parameters in GET

Option 1:

$str = iconv("gb2312","utf-8",$str);

Option 2 :

mb_convert_encoding($str, "utf-8", "gb2312");

The above is the detailed content of How to solve the Chinese garbled problem of php get. 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