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

PHP
php简单的分页程序
加强版phplib的DB类
PHP 数字左侧自动补0
mysql+php分页类(已测)
php读取30天之内的根据算法排序的代码
在php MYSQL中插入当前时间
用php获取远程图片并把它保存到本地的代码
生成php程序的php代码
在PHP中读取和写入WORD文档的代码
用来给图片加水印的PHP类
php md5下16位和32位的实现代码
php出现Cannot modify header information问题的解决方法大全
PHP提取中文首字母
php Ajax乱码
php时间不正确的解决方法
php的access操作类
如何在PHP程序中防止盗链
PHP中的extract的作用分析
PHP中用header图片地址 简单隐藏图片源地址
PHP防注入安全代码

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


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