457475451 发表于 2017-4-10 08:32:58

使用PHP来写批处理脚本 -- 多文件重命名处理

  rename-somefile.php 这里仅仅为一个小例子,使用PHP写批处理脚本,可以说是简单又实用啊,这里我写的一些例子,会陆续添加:

<?php
$files = scandir("e:/小说") ; //此函数在PHP5中才存在
$files_count = count($files) ;
print "\n" . $files_count ;
for($i=2;$i<$files_count;$i++) //去掉 . 和 ..
//print "\n" . $files[$i] ;
rename("e:/小说/". $files[$i],"e:/小说/". "$i.txt");
?>
页: [1]
查看完整版本: 使用PHP来写批处理脚本 -- 多文件重命名处理