PHP头条
热点:

php批量修改文件后缀


<?php
function foreachDir($path){
$handle=opendir($path);
if($handle){
while (false !== ($file = readdir($handle))) {
if($file!="." && $file!='..'){
if(is_dir($path.$file)){
echo $path.$file."<br/>";
foreachDir($path.$file);
}else{
echo "--".$path."/".$file."<br/>";
$ext = strripos($file,'.');
$aaa = substr($file,0,$ext);
rename($path.'/'.$file,$path.'/'.$aaa.'.JPG');
// die();
}
}
}
return false;
}
}
foreachDir('D:\xampp\htdocs\TNF2');

www.phpzy.comtrue/phprm/13584.htmlTechArticlephp批量修改文件后缀 ?php function foreachDir($path){ $handle=opendir($path); if($handle){ while (false !== ($file = readdir($handle))) { if($file!=. $file!=..){ if(is_dir($path.$file)){ echo $path.$file.br/; foreachDir($path.$file);...

相关文章

    暂无相关文章
相关频道:

PHP之友评论

今天推荐