url decode problem 解決方法
查了一下 RFC 3986: 有下面一段
Scheme names consist of a sequence of characters beginning with a letter and followed by any combination of letters, digits, plus ("+"), period ("."), or hyphen ("-").
RFC 2396 有下面的一段
The plus "+", dollar "$", and comma "," characters have been added to those in the "reserved" set, since they are treated as reserved within the query component.
表示加號(hào)已經(jīng)是url的保留字了,不需要轉(zhuǎn)義。
然后html4文檔里才有關(guān)于加號(hào)的轉(zhuǎn)義:
application/x-www-form-urlencoded
Forms submitted with this content type must be encoded as follows:
Control names and values are escaped. Space characters are replaced by`+', and then reserved characters.....
聲明只有content-type為application/x-www-form-urlencoded時(shí)才會(huì)對(duì)+做轉(zhuǎn)義。
又翻了下php的文檔,發(fā)現(xiàn)有一個(gè)
rawurlencode() - URL-encode according to RFC 3986
也就是php又搞了rawurlencode和rawurldecode把標(biāo)準(zhǔn)實(shí)現(xiàn)了。。。。
不能反一下么,畢竟大部分人應(yīng)該都會(huì)用urlencode。php真是蛋疼啊。。。。
相關(guān)文章
php實(shí)現(xiàn)用于驗(yàn)證所有類(lèi)型的信用卡類(lèi)
這篇文章主要介紹了php實(shí)現(xiàn)用于驗(yàn)證所有類(lèi)型的信用卡類(lèi),實(shí)例分析了信用卡類(lèi)的實(shí)現(xiàn)原理與相關(guān)使用技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-03-03ThinkPHP自動(dòng)轉(zhuǎn)義存儲(chǔ)富文本編輯器內(nèi)容導(dǎo)致讀取出錯(cuò)的解決方法
這篇文章主要介紹了ThinkPHP自動(dòng)轉(zhuǎn)義存儲(chǔ)富文本編輯器內(nèi)容導(dǎo)致讀取出錯(cuò)的解決方法,需要的朋友可以參考下2014-08-08Yii2框架實(shí)現(xiàn)注冊(cè)和登錄教程
這篇文章主要介紹了Yii2框架實(shí)現(xiàn)注冊(cè)和登錄教程的相關(guān)資料,需要的朋友可以參考下2016-09-09PHP幾個(gè)數(shù)學(xué)計(jì)算的內(nèi)部函數(shù)學(xué)習(xí)整理
下面主要講述 round, floor, ceil, pow, rand,max, min, decbin, bindec, dechex, hexdec, decoct, octdec 函數(shù)。2011-08-08php實(shí)現(xiàn)插入數(shù)組但不影響原有順序的方法
這篇文章主要介紹了php實(shí)現(xiàn)插入數(shù)組但不影響原有順序的方法,實(shí)例分析了php數(shù)組操作的技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-03-03php md5下16位和32位的實(shí)現(xiàn)代碼
PHP里MD5加密的16位和32位實(shí)現(xiàn)代碼,在網(wǎng)上一搜也有不少人有這方面的困惑,后來(lái)找到一個(gè)解決辦法,是正確的,就記錄下來(lái)2008-04-04PHP發(fā)送郵件確認(rèn)驗(yàn)證注冊(cè)功能示例【修改別人郵件類(lèi)】
這篇文章主要介紹了PHP發(fā)送郵件確認(rèn)驗(yàn)證注冊(cè)功能,結(jié)合實(shí)例形式分析了PHP開(kāi)源郵件操作類(lèi)的修改與使用技巧,需要的朋友可以參考下2019-11-11