// 检查文件是否已经存在
if(!file_exists($dbname)){
if(file_exists($ab_new_name)){
echo "具有相同名称的{$ab_new_name}文件<br><br>" ;
}else{
echo "命名失败,请人工检查{$filenum}网站<br><br>";
}
}else{
rename( $dbname, $ab_new_name);
} When using the rename function, please note that the paths of the two variables must be the same. If they are not the same, the named file will be renamed and moved to a new directory.