Home > Backend Development > PHP Tutorial > 急怎么解决php GET 中文参数的有关问题

急怎么解决php GET 中文参数的有关问题

WBOY
Release: 2016-06-13 10:23:45
Original
846 people have browsed it

急!!如何解决php GET 中文参数的问题?
我如果 
?md=北海道

$md=$_GET['md'];

//$md=iconv("gb2312","utf-8",$md); 如果这里不转码,就只有 “北海”两个字,

但是这里如果 转码,

echo $md 就变得啥都没了,


求解决方法,我搜了整个百度,也就这个方法编码来实现了,但是现在这种情况我也不知道怎么好了!!

------解决方案--------------------
你的页面编码是? 用urlencode()编码后呢?
------解决方案--------------------
在传递参数页面对参数使用urlencode,获得参数时使用urldecode

Related labels:
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