如何在我的图片上传名称代码中添加日期时间?
s.append(item)
答案 0 :(得分:0)
尝试一下。
$allowed_types=array('image/jpg','image/png');
$image_name=$_FILES['thumnail']['name'];
$array = explode('.', $image_name);
$fileName=$array[0];
$fileExt=$array[1];
$image_name=$fileName."_".time().".".$fileExt;
$tmp_name=$_FILES['thumnail']['tmp_name'];
move_uploaded_file($tmp_name,"upload/".$image_name);