php中批量修改文件后缀名的函数代码
2011-10-23 00:00
716 查看
<?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 chmod 函数与批量修改文件目录权限
- PHP chmod 函数与批量修改文件目录权限
- 批量修改RAR文件注释的php代码
- php 批量修改RAR文件注释代码(1/2)
- PHP实现批量修改文件后缀名的方法
- java批量修改本地文件夹中文件后缀名--代码
- Shell脚本批量修改文件后缀名代码分享
- PHP chmod 函数与批量修改文件目录权限
- PHP实现批量修改文件后缀名的方法
- Shell脚本批量修改文件后缀名代码分享
- php中判断文件空目录是否有读写权限的函数代码
- PHP批量删除、清除UTF-8文件BOM头的代码实例
- PHP批量删除、清除UTF-8文件BOM头的代码实例
- Python批量修改文件后缀名,文件内…
- php批量检测并去除BOM头的代码
- 用纯JS修改了网上的一个用PHP作的画折线图的代码
- 使用php代码加亮函数构造php小后门