<?php
$all_files = scandir(__DIR__);
foreach($all_files as $file)
if (mb_substr($file, -mb_strlen('.下载')) == '.下载')
rename($file, explode('.下载', $file)[0]);
<?php
$all_files = scandir(__DIR__);
foreach($all_files as $file)
if (mb_substr($file, -mb_strlen('.下载')) == '.下载')
rename($file, explode('.下载', $file)[0]);
本文标题:php重命名文件(去掉.下载后缀)
本文链接:https://www.haomeiwen.com/subject/xveusktx.html
网友评论