My site allows users to upload up to 10 files, but i'm having a bit of difficulty getting my validation code to work. I have an HTML array set up on the upload form like this
<input type=file name=pic[]>
<input type=file name=pic[]>
<input type=file name=pic[]>
<input type=file name=pic[]>
and so on. Then, I have a loop that runs through and checks to see if a file has been uploaded. This part is all fine, the problem comes here: How do I find out the file extension to limit only certain files to be uploaded?
Normally you would use something like
$file = $_POST['file']['type'];
but how do I do that when my variable is an array?
Thanks!