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

Solve the problem of garbled URL parameters in PHP

hzc
Release: 2023-03-01 12:20:01
Original
3006 people have browsed it

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');  // 对页面内容进行编码
Copy after login

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!

Related labels:
php
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template