JQuery中
编码
var url = 'folder/index.html?param=#23dd&noob=yes'; var encodedUrl = encodeURIComponent(url);
解码
var url = 'folder%2Findex.html%3Fparam%3D%2323dd%26noob%3Dyes'; var decodedUrl = decodeURIComponent(url);
php中
$str=urlencode ($url );//编码 $url=urldecode($str);//解码
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/20424.html