foreach ($_FILES["files"]["error"] as $key => $error) {
if ($error == UPLOAD_ERR_OK) {
$tmp_name = $_FILES["files"]["tmp_name"][$key];
$name = $_FILES["files"]["name"][$key];
move_uploaded_file($tmp_name, "uploads/$name");
}
}
foreach ($_FILES["files"]["error"] as $key => $error) {
if ($error == UPLOAD_ERR_OK) {
$tmp_name = $_FILES["files"]["tmp_name"][$key];
${'file_'.$key} = $_FILES["files"]["name"][$key];
move_uploaded_file($tmp_name, "uploads/$name");
}
}