教程集 www.jiaochengji.com
教程集 >  脚本编程  >  php  >  正文 php批量命名文件方法

php批量命名文件方法

发布时间:2016-10-27   编辑:jiaochengji.com
教程集为您提供php批量命名文件方法等资源,欢迎您收藏本站,我们将为您提供最新的php批量命名文件方法资源

今天我们利用opendir($dir))
{
while (($file = readdir($dh)) !== false)
{
if ($file != "." && $file != "..")
{
if(filetype($dir . $file) == 'file')
{
$newfile = str_replace(array('_PNG','_XML','_ICO'),array('.PNG','.XML','.ICO'), $file);
var_dump($file.' =======> '.$newfile.'<br />');
rename($dir . $file, $dir . $newfile);
}
}
}
closedir($dh);
}

</blockquote>

您可能感兴趣的文章:
linux命令行bash批量重命名文件
批量安装windows补丁的批处理(bat)脚本
什么是批处理
php批量命名文件方法
awk 单行命令批量修改文件名
dos命令批量修改文件扩展名的例子
linux下批量修改文件后缀的方法
mysql replace的用法(替换指定字段字符串)
php如何批量修改文件名
批量追加文件后缀名的批处理脚本

[关闭]
~ ~