<?php
// glob() 返回指定目录下的文件名以及目录
$arr = glob("blog.8688pic.com/*.JPG");
$i = 1;
// 循环遍历
foreach($arr as $file) {
// 获取图片后缀名
$ext = pathinfo($file,PATHINFO_EXTENSION);
// 确定图片的新名字
$name = $i++ . "." . 'jpg';
// 重命名
rename($file, $name);
}
die();
?>
最后修改:2022 年 03 月 09 日 10 : 39 AM
© 允许规范转载