My code is:
for($i = 0; $i < count($_FILES['creative']['name']['icon']); $i++) {
$name = mt_rand(0, time());
move_uploaded_file($_FILES['creative']['tmp_name']['icon']
[$i],'creatives/'.$name.'.png');
move_uploaded_file($_FILES['creative']['tmp_name']['image']
[$i],'creatives/'.$name.'.png');
}
The problem is that in this code only the last move_uploaded_file
works and uploads an image.
Can you explain me why the first move_uploaded_file
does not work?