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

PHP
php获取mysql版本的几种方法小结
php下判断数组中是否存在相同的值array_unique
PHP中ADODB类详解
常用的php ADODB使用方法集锦
用phpmyadmin更改mysql5.0登录密码
MySQL修改密码方法总结
使用 MySQL Date/Time 类型
How do I change MySQL timezone?
mysql时区问题
某大型网络公司应聘时的笔试题目附答案
PHP连接access数据库
优化PHP代码的40条建议
php简单静态页生成过程
PHP 5.0对象模型深度探索之属性和方法
PHP 5.0对象模型深度探索之对象复制
php,ajax实现分页
FCKeditor添加自定义按钮
php中用文本文件做数据库的实现方法
PHP详细彻底学习Smarty
php图片验证码代码

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


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