note 109437 deleted from features.file-upload.multiple by peehaa
| From: | peehaa@php.net | Date: | Mon, 04 Nov 2013 09:11:14 +0000 |
| Subject: | note 109437 deleted from features.file-upload.multiple by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-197425@lists.php.net to get a copy of this message | ||
Note Submitter: molnar at mediacube dot sk
----
I'am using this to normalize $_FILES array. It's short and clean, normalizes fields with
single upload or multiupload. It uses explicit array typecast:
<?php
function getNormalizedFILES()
{
$newfiles = array();
foreach($_FILES as $fieldname => $fieldvalue)
foreach($fieldvalue as $paramname => $paramvalue)
foreach((array)$paramvalue as $index => $value)
$newfiles[$fieldname][$index][$paramname] = $value;
return $newfiles;
}
?>