自定义url变量转义方法
thinkphp等系统专用,url传递的参数不能带有/等特殊字符function base_encode($str) {
$src = array("/","+","=","?","&");
$dist = array("_.a._","_.b._","_.c._","_.d._","_.e._");
$new = str_replace($src,$dist,$str);
return $new;
}
function base_decode($str) {
$src = array("_.a._","_.b._","_.c._","_.d._","_.e._");
$dist = array("/","+","=","?","&");
$new = str_replace($src,$dist,$str);
return $new;
}
以上就是自定义url变量转义方法的内容,更多相关内容请关注PHP中文网(www.php.cn)!
本文原创发布php中文网,转载请注明出处,感谢您的尊重!