The change is only a few lines - the call to move_uploaded_file has been replaced with
$pathinfo = pathinfo($_FILES['file']['name'][$i]); $dest = $pathinfo['filename'] . strftime('-%Y%m%d-%H%M%S.') . $pathinfo['extension']; move_uploaded_file($_FILES['file']['tmp_name'][$i], $dest);
The result is each uploaded file has the current date and time appended to it (for example, vorpal.jpeg becomes vorpal-20141120-205045.jpeg). Obviously this will still overwrite files if you manage to upload the same filename multiple times within the same second, to which my answer is meh! As before, feel free to use it under the 3-clause BSD license.