PHP Image唯一ID

时间:2016-12-24 02:16:50

标签: php

我正在创建一个图片上传系统,将图片发送到它想要去的文件夹并且它可以工作。但我想创建一个图像ID,这样如果用户张贴相同的图片,它就不会相互混淆。我已经把代码放了,但图像仍然按名称保存。我可以得到帮助吗?

if ($uploadOk) {
//If upload is OK, then go ahead
printf("uniqid(): %s\r\n", uniqid()); 
move_uploaded_file($_FILES['fileToUpload']['tmp_name'], $target_file);
header('Location: profile.php');
// Move the uploaded file to the desired folder
}

0 个答案:

没有答案