一段PHP在地址栏的中文传值出现乱码
在IE下,中文传值,最后一个汉字变成了乱码,导致抓不出数据。
但是在火狐里面又可以。
传值页面,mysql,查询,接收值页面,均是UTF-8字库
这是咋回事呢?
------解决方案--------------------
把这个参数url_encode($name);一下
接下来时再url_decode($_GET['Tclass']);
------解决方案--------------------
//a.<a style="color:#f60; text-decoration:underline;" title="php" href="https://www.php.cn/zt/15714.html" target="_blank">php</a>
<a href="b.php?Tclass=<?php%20echo%20urlencode('test%E5%A4%A9%E8%8A%B1%E6%9D%BF');?>">aaaa</a>
//b.php
$T_class=$_GET['Tclass'];
echo urldecode($T_class); //test天花板
<br><font color="#e78608">------解决方案--------------------</font><br>echo "echo "
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号