Code will help to to select and upload multiple files with HTML and PHP.
Project structure
uploadMultipleFile/
┣ Destination/
┣ index.php
┗ uploadFiles.php
Destination - is is directory where we will upload all or files
index.php
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Muptiple Files</title>
</head>
<body>
<form action="uploadFiles.php" method="post" enctype="multipart/form-data">
<div><input type="file" name="multiple_files[]" multiple></div>
<div><input type="submit" class="submit_button"></div>
</form>
</body>
</html>
uploadFiles.php
<?php
$file_name = $_FILES['multiple_files']['name'];
$temp_file_name = $_FILES['multiple_files']['tmp_name'];
$total_files = count($temp_file_name);
for ($i = 0; $i < $total_files; $i++) {
if (move_uploaded_file($temp_file_name[$i], "Destination/" . $file_name[$i])) {
echo "Succesfull uploaded";
}
}
Output:
Code is tested and it will work 100% for you