欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2022-07-01 15:25:20
<!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>