嘿,我正在尝试在上传时更改文件名(如果存在),但似乎我有问题。这是代码..
$tempfilename = $filename["name"];
while(file_exists($location . $tempfilename))
{
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$shuffled = str_shuffle($chars);
$stringa = substr($shuffled,0,7);
move_uploaded_file($filename["tmp_name"], $location . $filename["name"]);
$tempfilename = $stringA.$filename["name"];
}
move_uploaded_file($filename["tmp_name"], $location.$stringa.$filename["name"]);
clearstatcache();
这似乎不起作用
不知道我错过了什么。