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

yipeiwu_com6年前PHP代码库
<!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>

相关文章

PHP基于单例模式实现的数据库操作基类

本文实例讲述了PHP基于单例模式实现的数据库操作基类。分享给大家供大家参考,具体如下: 配置文件: <?php $db = array( 'host'=>...

浅谈PHP中的&lt;&lt;&lt;运算符

PHP中提供了<<<运算符构建多行字符串序列的方法,通常称为here-document或表示为heredoc的简写。 这种方法详细表述了字符串的字面值,并在文本中保留了...

解析argc argv在php中的应用

argc,argv 用命令行编译程序时有用我们会在定时任务脚本中发现这样的参数,$obj->run($argv[1]);*/30 * * * * /usr/local/bin/ph...

用php将任何格式视频转为flv的代码

复制代码 代码如下:<? define("ROOT_DIR",dirname(__FILE__)); class EcodeFlv { var $fromFile; //上传来的文...

php关闭warning问题的解决方法

error_reporting 设定错误讯息回报的等级 2047我记得应该是E_ALL。 php.ini 文件中有许多配置设置。您应当已经设置好自己的php.ini 文件并把它放在合适的...