Solve the problem of garbled URL parameters in PHP

hzc
Release: 2023-03-01 12:20:01
Original
2637 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
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 [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!