JS encodeURI() encodeURI() encodeURIComponent()



說明



這是一個把特殊字元轉換成編碼,以便於傳輸的function。



encodeURI()



請不要使用他



encodeURI()



這個函式不會編碼 ~!@#$&*()=:/,;?+'


空白字元 %20



encodeURIComponent()



這個函式不會編碼 ~!*()'


空白字元 %20



如果你想要與PHP之間做完全的轉換,請使用js的encodeURIComponent與php的rawurlencode。



相關連結



PHP urlencode urldecode






留言

這個網誌中的熱門文章

成人剪舌繫帶聽過嗎?我剪了!!

Scp - ssh 的遠端檔案傳輸指令

睡覺使你更有效率