教程集 www.jiaochengji.com
教程集 >  脚本编程  >  php  >  正文 php url地址栏传中文值乱码问题与解决方法

php url地址栏传中文值乱码问题与解决方法

发布时间:2016-10-27   编辑:jiaochengji.com
教程集为您提供php url地址栏传中文值乱码问题与解决方法等资源,欢迎您收藏本站,我们将为您提供最新的php url地址栏传中文值乱码问题与解决方法资源
<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy8401')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy8401>

$url = 'aaa.php?region='.urldecode("四川省");

?>
<a href="<?php echo $url;?>">aaa </a>

//方法二base64_encode

<?
$test="四川省";
$test1=base64_encode($test);
echo '<a href="www.jiaochengji.com?region=$test1">aaa </a>';
?>

另一页面使用base64_decode解开

base64_decode($region);

//方法三让服务器支持中文

[root@dhcp ~]# locale

lang=zh_cn.utf-8
lc_ctype="zh_cn.utf-8"
lc_numeric="zh_cn.utf-8"
lc_time=c
lc_collate=c
lc_monetary="zh_cn.utf-8"
lc_messages="zh_cn.utf-8"
lc_paper="zh_cn.utf-8"
lc_name="zh_cn.utf-8"
lc_address="zh_cn.utf-8"
lc_telephone="zh_cn.utf-8"
lc_measurement="zh_cn.utf-8"
lc_identification="zh_cn.utf-8"
lc_all=
[root@dhcp ~]#

 

您可能感兴趣的文章:
asp.net url 地址栏乱码,中文超过两个汉字就乱码
php url地址栏传中文值乱码问题与解决方法
PHP URL传递中文乱码问题解决办法
php中文乱码问题解决方法
php网页标题中文乱码如何解决
asp读sql数据时出现乱码问题的解决方法
php伪静态如何获取地址栏url
php分割GBK中文乱码的解决方法
js url传值中文乱码的简单解决办法
php解析JSON中文乱码问题的解决方法

上一篇:HTTPcookie支持 下一篇:网站规划书浅析
[关闭]
~ ~