It is possible to upload multiple files simultaneously and have the information organized automatically in arrays for you. To do so, you need to use the same array submission syntax in the HTML form as you do with multiple selects and checkboxes:
Note: Support for multiple file uploads was added in version 3.0.10.
When the above form is submitted, the arrays $userfile, $userfile_name, and $userfile_size will be formed in the global scope (as well as in $HTTP_POST_FILES ($HTTP_POST_VARS in PHP 3)). Each of these will be a numerically indexed array of the appropriate values for the submitted files.
For instance, assume that the filenames /home/test/review.html and /home/test/xwp.out are submitted. In this case, $userfile_name would contain the value review.html, and $userfile_name would contain the value xwp.out. Similarly, $userfile_size would contain review.html's filesize, and so forth.
$userfile['name'], $userfile['tmp_name'], $userfile['size'], and $userfile['type'] are also set.