PHP对URL传递的参数值进行编码 函数urlencode("")
<a href="1.php?id=<?php echo urlencode("看不懂吧?")?>">php对URL编码</a>
返回值:http://localhost/1.php?id=%E7%9C%8B%E4%B8%8D%E6%87%82%E5%90%A7%EF%BC%9F
PHP对URL传递的参数值进行解码 函数urldecode("")
<a href="1.php?id=<?php echo urldecode("%E7%9C%8B%E4%B8%8D%E6%87%82%E5%90%A7%EF%BC%9F")?>">php对URL编码</a>
<?php echo "您提交的查询字符串内容是:".urldecode($_GET[id]);?>
返回值:http://localhost/1.php?id=看不懂吧?