表单 HTML :
<form method="post" enctype="multipart/form-data">
<input type="file" name="file[]" multiple="multiple">
</form>
php 端通过 $_FILES 获取到的值:
Array
(
[file] => Array
(
[name] => Array
(
[0] => 1.jpg
[1] => 2.jpg
)
[type] => Array
(
[0] => image/jpeg
[1] => image/jpeg
)
[tmp_name] => Array
(
[0] => /tmp/php330E.tmp
[1] => /tmp/php330F.tmp
)
[error] => Array
(
[0] => 0
[1] => 0
)
[size] => Array
(
[0] => 59420
[1] => 300300
)
)
)
请问 html 元素里有什么属性可以让 php 端通过 $_FILES 获取到的值变成这样,或者 php 里有什么非常简便的方法、函数可以变成这样:
Array
(
[file] => Array
(
[0] => Array
(
[name] => 1.jpg
[type] => image/jpeg
[tmp_name] => /tmp/php330E.tmp
[error] => 0
[size] => 59420
)
[1] => Array
(
[name] => 2.jpg
[type] => image/jpeg
[tmp_name] => /tmp/php330F.tmp
[error] => 0
[size] => 300300
)
)
)