php 批量修改文件后缀名
批量修改文件后缀名 **批量修改文件后缀名**```{.php}lt;?phpfunction foreachDir($path){ $handle=opendir($path); if($handle){ while (false !== ($file = readdir($handle))) { if($file!=quot;.quot; amp;amp; $fil
批量修改文件后缀名
<?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');
- 上一篇:php制作缩略图
- 下一篇:php实现简单的用户登录
精彩图集
精彩文章