<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
</head>
<body>
<form method="post" enctype="multipart/form-data">
<input name="upload[]" type="file" multiple="multiple" />
<button type="submit" name="btn-upload">upload</button>
</form>
<?php
//$files = array_filter($_FILES[\'upload\'][\'name\']); something like that to be used before processing files.
// Count # of uploaded files in array
$total = count($_FILES[\'upload\'][\'name\']);
// Loop through each file
for($i=0; $i < $total; $i++)
{
//Get the temp file path
$tmpFilePath = $_FILES[\'upload\'][\'tmp_name\'][$i];
//Make sure we have a filepath
if ($tmpFilePath != ""){
//Setup our new file path
$newFilePath = "./uploadFiles/" . $_FILES[\'upload\'][\'name\'][$i];
//Upload the file into the temp dir
if(move_uploaded_file($tmpFilePath, $newFilePath)) {
//Handle other code here
}
}
}
?>
</body>
</html>