Justin's Words

解析多文件上传 - PHP

解析多文件上传

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
function parseMultiFileUpload($file, $e = false) {
$arr = [];
foreach ($file as $key => $value) {
foreach ($file[$key] as $k => $v) {
if (!$e) {
if ($file['error'][$k] != 0) {
continue;
}
}
$arr[$k][$key] = $file[$key][$k];
}
}
return $arr;
}
?>