url过码后,php程序获取参数出现乱码

WBOY
Release: 2016-06-23 14:17:40
Original
960 people have browsed it

这样一个url
http://localhost/index.php?app=search&keyword= %D0%DD%CF%D0%BF%E3
红色部份是中文, 经过编码的,效果等同于js中的encodeURI,但在php $_GET['keyword']获得后却是乱码 这样的,不知道该怎么样解决


回复讨论(解决方案)

因为你传过去的urlencode是gbk编码的结果,而你接收文件却是utf-8的?
统一了就好
休闲裤。

嗯,楼上正解

%D0%DD%CF%D0%BF%E3 休闲裤
在 utf-8 页面中显示为 

页面要统一编码。

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