note 116700 deleted from features.file-upload.multiple by didou
| From: | didou@php.net | Date: | Fri, 13 Feb 2015 00:56:28 +0000 |
| Subject: | note 116700 deleted from features.file-upload.multiple by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-201713@lists.php.net to get a copy of this message | ||
Note Submitter: office at moving-bytes dot at
----
i use array_filter to get rid of the empty fields,
of cause now you could count( $_FILES['file']['name']) to get the real amount of
files uploaded.
<?php
$_FILES['file']['name'] =
array_filter($_FILES['file']['name'], function($x) { return !empty($x); });
$i=0;
foreach ($_FILES['file']['name'] as $file)
{
var_dump($_FILES['file']['name'][$i]);
var_dump($_FILES['file']['tmp_name'][$i]);
$i++;
}
?>