时间:2021-07-01 10:21:17 帮助过:6人阅读
//这个函数接收的都是路径,所以判断了文件扩展名
function shell2txt($a){
$ary = explode('/', $a);
foreach($ary as $k => $v){
if(strpos($v, '?\\') !== false){
$_ary = explode('?\\', $v);
foreach($_ary as $_k=>$_v){
if($_v == '') continue;
//判断是否有文件扩展名
$end = '';
if(strpos($_v, '.') !== false){
$end = substr($_v, strpos($_v, '.'));
}
$_ary[$_k] = dechex($_v).$end;
}
$ary[$k] = implode('%', $_ary);
}
}
$a = implode('/', $ary);
return urldecode($a);
}