jq的get傳參數(shù)在utf-8中亂碼問題的解決php版
更新時(shí)間:2008年07月23日 19:54:10 作者:
在php下用jquery傳參出現(xiàn)亂碼的解決方法
<!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>
<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 iconv 解決utf-8和gb2312編碼轉(zhuǎn)換問題
- PHP亂碼問題,UTF-8亂碼常見問題小結(jié)
- php中utf-8編碼下用正則表達(dá)式如何匹配漢字
- php中隱形字符65279(utf-8的BOM頭)問題
- php中json_encode UTF-8中文亂碼的更好解決方法
- php utf-8轉(zhuǎn)unicode的函數(shù)
- PHP utf-8編碼問題,utf8編碼,數(shù)據(jù)庫亂碼,頁面顯示輸出亂碼
- php中文亂碼怎么辦如何讓瀏覽器自動(dòng)識別utf-8
- PHP 截取字符串函數(shù)整理(支持gb2312和utf-8)
- php UTF-8、Unicode和BOM問題
- PHP如何實(shí)現(xiàn)Unicode和Utf-8編碼相互轉(zhuǎn)換
- php smarty截取中文字符亂碼問題?gb2312/utf-8
- PHP 與 UTF-8 的最佳實(shí)踐詳細(xì)介紹
相關(guān)文章
PHP8使用Attributes管理代碼元數(shù)據(jù)的示例詳解
在PHP 8中引入了一項(xiàng)強(qiáng)大的功能,即"Attributes"(屬性),它們提供了一種新的方法來管理和操縱代碼元數(shù)據(jù),Attributes允許你在代碼中添加元數(shù)據(jù),本文給大家介紹了在PHP8中是如何使用Attributes管理代碼元數(shù)據(jù),需要的朋友可以參考下2023-12-12php出現(xiàn)web系統(tǒng)多域名登錄失敗的解決方法
這篇文章主要介紹了php出現(xiàn)web系統(tǒng)多域名登錄失敗的解決方法,針對同一頂級域名下的各子站出現(xiàn)登錄失敗的情況非常有用,需要的朋友可以參考下2014-09-09比較全的PHP 會話(session 時(shí)間設(shè)定)使用入門代碼
由于 Session 是以文本文件形式存儲在服務(wù)器端的,所以不怕客戶端修改 Session 內(nèi)容。實(shí)際上在服務(wù)器端的 Session 文件,PHP 自動(dòng)修改 Session 文件的權(quán)限,只保留了系統(tǒng)讀和寫權(quán)限,而且不能通過 ftp 修改,所以安全得多。2008-06-06php結(jié)合安卓客戶端實(shí)現(xiàn)查詢交互實(shí)例
本文給大家分享的是php結(jié)合安卓客戶端實(shí)現(xiàn)查詢交互實(shí)例,java端主要分三步來實(shí)現(xiàn):首先進(jìn)行 http request.網(wǎng)絡(luò)請求相關(guān)操作,第二步,使用execute方法發(fā)送HTTP GET請求,并返回HttpResponse對象,第三步,使用getEntity方法活得返回結(jié)果。有需要的小伙伴參考下2015-05-05