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

PHP
解决MySQL中文输出变成问号的问题
PHP页面间传递参数实例代码
php下通过POST还是GET来传值
PHP组合查询多条件查询实例代码
PHP简单系统查询模块代码打包下载
PHP添加MySQL数据记录代码
PHP insert语法详解
用PHP进行MySQL删除记录操作代码
PHP简单系统数据添加以及数据删除模块源文件下载
用PHP连接MySQL代码的参数说明
PHP实现MySQL更新记录的代码
PHP-MySQL教程归纳总结
PHP时间戳使用实例代码
PHP中MD5函数使用实例代码
php mysql索引问题
介绍php设计模式中的工厂模式
Php注入点构造代码
坏狼的PHP学习教程之第1天
坏狼的PHP学习教程之第2天
坏狼的PHP学习教程之第3天

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


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