I have this form :
<form enctype="multipart/form-data" action="upload.php" method="POST">
<input type="file" name="photo[]" />
<input type="file" name="photo[]" />
</form>
And I upload the files with php this way :
function upFiles($files){
for($i = 0 ; $i < $files ; $i++){
$FV_filename = $_FILES['photo']['name'][$i];
$fileTYPE = substr($FV_filename , -4);
move_uploaded_file($_FILES['photo']['tmp_name'][$i], uniqid().$fileTYPE);
}
}
upFiles($_POST['howManyFiles']);
As you can see I get from the the client side how many files have been sent.
What I want to do is to check in the server side how many files have been received.
How can I do that? Is there any built in php function, if not then how to create one?
should work. Alternatively, just rewrite your
forloop to aforeach: