Home  >  Article  >  Backend Development  >  Solve the problem of garbled URL parameters in PHP

Solve the problem of garbled URL parameters in PHP

hzc
hzcOriginal
2020-06-05 14:48:402888browse

Solve the problem of garbled URL parameters in PHP

How to solve the problem of garbled URL parameters in PHP:

When using PHP language to do server-side redirection, the Chinese garbled problem may occur?

The solution is also very simple:

$contents= file_get_contents('http://www.yitire.com/'); // 获取 页面内容
$en_contents=mb_convert_encoding($contents, 'UTF-8', 'UTF-8,GBK,GB2312,BIG5');  // 对页面内容进行编码

The disadvantage of this kind of server-side jump is that it cannot pass session and cookie, but there are also corresponding methods to solve it.

Recommended tutorial: "php tutorial"

The above is the detailed content of Solve the problem of garbled URL parameters in PHP. 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