У меня есть форма, в которой есть такие поля:
<input type="file" name="images[]" />
<input type="file" name="images[]" />
<input type="file" name="images[]" />
<input type="file" name="images[]" />
Я ожидаю, что сделаю что-то вроде этого:
Array
(
[images] => Array
(
[0] => Array
(
[name] => test.jpg
[type] => image/jpeg
[tmp_name] => /tmp/nsl54Gs
[error] => 0
[size] => 1715
)
[1] => Array
(
[name] => test.jpg
[type] => image/jpeg
[tmp_name] => /tmp/nsl54Gs
[error] => 0
[size] => 1715
)
[2] => Array
(
[name] => test.jpg
[type] => image/jpeg
[tmp_name] => /tmp/nsl54Gs
[error] => 0
[size] => 1715
)
[3] => Array
(
[name] => test.jpg
[type] => image/jpeg
[tmp_name] => /tmp/nsl54Gs
[error] => 0
[size] => 1715
)
)
)
Но я получаю что-то вроде этого:
Array
(
[images] => Array
(
[name] => Array
(
[0] => test.jpg
[1] => test.jpg
[2] => test.jpg
[3] => test.jpg
)
[type] => Array
(
[0] => image/jpeg
[1] => image/jpeg
[2] => image/jpeg
[3] => image/jpeg
)
[tmp_name] => Array
(
[0] => /tmp/nsl54Gs
[1] => /tmp/nsl54Gs
[2] => /tmp/nsl54Gs
[3] => /tmp/nsl54Gs
)
[error] => Array
(
[0] => 0
[1] => 0
[2] => 0
[3] => 0
)
[size] => Array
(
[0] => 1715
[1] => 1715
[2] => 1715
[3] => 1715
)
)
)
Как получить массив в ожидаемой форме?