当前位置 : 主页 > 网络编程 > PHP >

自定义url变量转义方法

来源:互联网 收集:自由互联 发布时间:2021-07-03
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._","_.
 
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;
  
}

网友评论