当前位置: 首页 > 图文教程 > 网络编程 > PHP > jq的get传参数在utf-8中乱码问题的解决php版

PHP
在PHP中使用模板的方法
php中iconv函数使用方法
谈谈新手如何学习PHP网络编程
JS实现php的伪分页
需要使用php模板的朋友必看的很多个顶级PHP模板引擎比较分析
五个PHP程序员工具
CodeIgniter php mvc框架 中国网站
php mysql数据库操作类
php MySQL与分页效率
WindowsXP中快速配置Apache+PHP5+Mysql
php创建多级目录代码
php中对xml读取的相关函数的介绍一
Excel数据导入Mysql数据库的实现代码
比较全的PHP 会话(session 时间设定)使用入门代码
快速配置PHPMyAdmin方法
MySQL数据源表结构图示
改变Apache端口等配置修改方法
PHP读取MySQL数据代码
详解PHP显示MySQL数据的三种方法
PHP中Date获取时间不正确怎么办

PHP 中的 jq的get传参数在utf-8中乱码问题的解决php版


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 264 ::
收藏到网摘: n/a

在php下用jquery传参出现乱码的解决方法 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script>
document.write(escape("哈哈")+"<br>");
document.write(unescape("%u54C8%u54C8")+"<br>");
document.write(encodeURIComponent("哈哈")+"<br>");
document.write(decodeURIComponent("%E5%93%88%E5%93%88")+"<br>");
</script>
</head>
<body>
<?php
echo urldecode("%E5%93%88%E5%93%88");
echo "<br>";
echo rawurldecode("%E5%93%88%E5%93%88");
echo "<br />";
echo utf8_decode("%E5%93%88%E5%93%88");
echo "<br />";
echo "%E5%93%88%E5%93%88";
echo "<br />";
echo $_GET['act'];
echo "<br />";
echo urlencode($_GET['act']);
?>
</body>
</html>