I have an array like the first picture below. Is it possible to re-arrange the array position like the second picture below? So that it can arranged file0, file1, file2 and so on.
Multiple Array
Single Array
I have an array like the first picture below. Is it possible to re-arrange the array position like the second picture below? So that it can arranged file0, file1, file2 and so on.
Multiple Array
Single Array
Never mind, I solved my own answer by sorting like this
$count = count($_FILES['file']['name']);
$sort_arr = [];
for ($i=0; $i < $count; $i++) {
$sort_arr['file'.$i]['name'] = $_FILES['file']['name'][$i];
$sort_arr['file'.$i]['type'] = $_FILES['file']['type'][$i];
$sort_arr['file'.$i]['tmp_name'] = $_FILES['file']['tmp_name'][$i];
$sort_arr['file'.$i]['error'] = $_FILES['file']['error'][$i];
$sort_arr['file'.$i]['size'] = $_FILES['file']['size'][$i];
}