在网上找了很久都没有找到解决方法,谷歌也去找了,也没看到合适的解决方法,请大神帮忙解决一下,谢谢了
运行环境是: win10 php5.6 Apache
/**
* 编码
* @param unknown $keytitle
* @param string $mo
*/
function strencd($keytitle,$mo="UTF-8"){
$encode = mb_detect_encoding($keytitle, array('ASCII','UTF-8','GB2312','GBK','BIG5'));
//echo $encode;exit;
if ($encode != $mo){
return iconv($encode,$mo,$keytitle);
}
return $keytitle;
}//如果直接这样使用没有事$name = strencd('一种危化品道路运输流域-合格通知书','GB2312');
rename("./file/20190325093104/2019032217652255","./file/20190325093104/".$name);
//如果名字是从其他地方获取来的,就会报错 $name=trim($tzsdc['FAMINGMC'].'-'.$tzsdc['TONGZHISMC']);
$nfile = './file/'.$get['f'].'/'.$name;
$jfile ='./file/'.$get['f'].'/'.$tzsdc['tongzhisbh'];
$name1= strencd($jfile,'GB2312');
$name2= strencd($nfile,'GB2312');
rename($name1,$name2);错误信息PHP Warning: rename(./file/20190327085438/GA000192607459,./file/20190327085438/床尾椅-通知书): 拒绝访问。 (code: 5) in D:\phpStudy\WWW\qq\zlcpc\plgw.php on line 446
Warning: rename(./file/20190327085438/GA000192607459,./file/20190327085438/床尾椅-通知书): 拒绝 访问。 (code: 5) in D:\phpStudy\WWW\qq\zlcpc\plgw.php on line 446
运行环境是: win10 php5.6 Apache
/**
* 编码
* @param unknown $keytitle
* @param string $mo
*/
function strencd($keytitle,$mo="UTF-8"){
$encode = mb_detect_encoding($keytitle, array('ASCII','UTF-8','GB2312','GBK','BIG5'));
//echo $encode;exit;
if ($encode != $mo){
return iconv($encode,$mo,$keytitle);
}
return $keytitle;
}//如果直接这样使用没有事$name = strencd('一种危化品道路运输流域-合格通知书','GB2312');
rename("./file/20190325093104/2019032217652255","./file/20190325093104/".$name);
//如果名字是从其他地方获取来的,就会报错 $name=trim($tzsdc['FAMINGMC'].'-'.$tzsdc['TONGZHISMC']);
$nfile = './file/'.$get['f'].'/'.$name;
$jfile ='./file/'.$get['f'].'/'.$tzsdc['tongzhisbh'];
$name1= strencd($jfile,'GB2312');
$name2= strencd($nfile,'GB2312');
rename($name1,$name2);错误信息PHP Warning: rename(./file/20190327085438/GA000192607459,./file/20190327085438/床尾椅-通知书): 拒绝访问。 (code: 5) in D:\phpStudy\WWW\qq\zlcpc\plgw.php on line 446
Warning: rename(./file/20190327085438/GA000192607459,./file/20190327085438/床尾椅-通知书): 拒绝 访问。 (code: 5) in D:\phpStudy\WWW\qq\zlcpc\plgw.php on line 446
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货