PHP重命名文件夹下的文件后缀名
public function zhuanhouzuiming(){
$lujings='upload/';
$filesnames = scandir($lujings,1);
foreach ($filesnames as $k=>$v){
$xv=$lujings.$v;$info = pathinfo($xv);
//如果mp3要重命名amr
if($info['extension']=='mp3'){$xss=basename($xv,".mp3");
rename($xv,'upload/'.$xss.'.amr');
}}
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/19055.html