「複数の複数の(タイプミスではない)ファイルのアップロード」から派生した次のprint_rがあります。
Array
(
[file] => Array
(
[name] => Array
(
[1] => Array
(
[0] => IMG_8502 f 5 .jpg
[1] => IMG_8507 f 5 .jpg
)
[2] => Array
(
[0] => IMG_8508 f 5 .jpg
[1] => IMG_8529 f 5 .jpg
[2] => IMG_8612 fff 5 .jpg
)
[3] => Array
(
[0] => IMG_8502 f 5 .jpg
[1] => IMG_8507 f 5 .jpg
)
)
[type] => Array
(
[1] => Array
(
[0] => image/jpeg
[1] => image/jpeg
)
[2] => Array
(
[0] => image/jpeg
[1] => image/jpeg
[2] => image/jpeg
)
[3] => Array
(
[0] => image/jpeg
[1] => image/jpeg
)
)
[tmp_name] => Array
(
[1] => Array
(
[0] => C:\wamp\tmp\php1CC.tmp
[1] => C:\wamp\tmp\php1FC.tmp
)
[2] => Array
(
[0] => C:\wamp\tmp\php23B.tmp
[1] => C:\wamp\tmp\php26B.tmp
[2] => C:\wamp\tmp\php2AB.tmp
)
[3] => Array
(
[0] => C:\wamp\tmp\php2CB.tmp
[1] => C:\wamp\tmp\php30A.tmp
)
)
[error] => Array
(
[1] => Array
(
[0] => 0
[1] => 0
)
[2] => Array
(
[0] => 0
[1] => 0
[2] => 0
)
[3] => Array
(
[0] => 0
[1] => 0
)
)
[size] => Array
(
[1] => Array
(
[0] => 2776165
[1] => 2380025
)
[2] => Array
(
[0] => 2456713
[1] => 2585779
[2] => 1770128
)
[3] => Array
(
[0] => 2776165
[1] => 2380025
)
)
)
)
<?php
if(isset($_FILES['file'])=== true){
$files = $_FILES['file'];
for($x = 0; $x < count($files['name'][$x]); $x++){
$file_name = $files['name'][$x];
$tmp_name = $files['tmp_name'][$x];
move_uploaded_file($tmp_name, 'documents/'.$file_name);
}}?>
実際の名前と tmp 配列にアクセスするには、別の for ループを埋め込む必要があると思います... name1、name2、name3。それに応じて移動できるように、各サブ配列にアクセスできるようにしたいと思います