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

PHP
PHP图片上传类带图片显示
用PHP中的 == 运算符进行字符串比较
使PHP自定义函数返回多个值
在PHP中使用与Perl兼容的正则表达式
PHP中的cookie
PHP 应用程序的安全 -- 不能违反的四条安全规则
PHP date函数参数详解
PHP读写文件的方法(生成HTML)
PHP如何得到当前页和上一页的地址?
PHP完整的日历类(CLASS)
php类
mysq GBKl乱码
php字符串截取问题
PHP+AJAX实现无刷新注册(带用户名实时检测)
windows xp下安装pear
专为新手写的结合smarty的类
PHP 中的面向对象编程:通向大型 PHP 工程的办法
数组处理函数库
PHP 选项及相关信息函数库
PHP 已经成熟

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 336 ::
收藏到网摘: 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>