I have this file upload input in a form:
<input type="file" multiple name="file[]" />
I have a script which appends this multiple times within the form.
Could I determine which row each file[] array belongs to in php?
<?php
if(isset($_FILES['file'])=== true){
$files = array ($_FILES['file']);
}
var_dump($files);
?>
array (size=1)
0 =>
array (size=5)
'name' =>
array (size=5)
0 => string 'IMG_8502 f 5 .jpg' (length=17)
1 => string 'IMG_8507 f 5 .jpg' (length=17)
2 => string 'IMG_8508 f 5 .jpg' (length=17)
3 => string 'IMG_8529 f 5 .jpg' (length=17)
4 => string 'IMG_8612 fff 5 .jpg' (length=19)
'type' =>
array (size=5)
0 => string 'image/jpeg' (length=10)
1 => string 'image/jpeg' (length=10)
2 => string 'image/jpeg' (length=10)
3 => string 'image/jpeg' (length=10)
4 => string 'image/jpeg' (length=10)
'tmp_name' =>
array (size=5)
0 => string 'C:\wamp\tmp\phpE892.tmp' (length=23)
1 => string 'C:\wamp\tmp\phpE8D1.tmp' (length=23)
2 => string 'C:\wamp\tmp\phpE911.tmp' (length=23)
3 => string 'C:\wamp\tmp\phpE950.tmp' (length=23)
4 => string 'C:\wamp\tmp\phpE99F.tmp' (length=23)
'error' =>
array (size=5)
0 => int 0
1 => int 0
2 => int 0
3 => int 0
4 => int 0
'size' =>
array (size=5)
0 => int 2776165
1 => int 2380025
2 => int 2456713
3 => int 2585779
4 => int 1770128
I would like to get each set of files uploaded into their own array. In other words name 0-4 set to be array 0 and then for the next set of files uploaded in the next row to be array 1 and so on. so i can store each set of files with their associated text in the form
Test output: