note 124446 added to reserved.variables.files
| From: | dariusakafest at gmail dot com | Date: | Wed, 27 Nov 2019 12:30:41 +0000 |
| Subject: | note 124446 added to reserved.variables.files | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-213271@lists.php.net to get a copy of this message | ||
Good normalized the $_FILES array so
function getRequestFiles()
{
$result = array();
if (is_array($_FILES)) {
foreach($_FILES as $name => $fileArray) {
$row = array();
foreach ($fileArray as $key => &$data) {
findNoArrayElementAndReplace($data, $key);
$row = array_merge_recursive($row, $data);
}
$result[$name] = $row;
}
}
return $result;
}
function findNoArrayElementAndReplace(&$array, $key)
{
if (is_array($array)) {
foreach ($array as &$item) {
findNoArrayElementAndReplace($item, $key);
}
} else {
$array = array(
$key => $array
);
}
}
----
Server IP: 208.43.231.9
Probable Submitter: 185.85.3.168 (proxied: 5.199.242.103)
----
Manual Page -- http://php.net/manual/en/reserved.variables.files.php
Edit -- https://master.php.net/note/edit/124446
Del: integrated -- https://master.php.net/note/delete/124446/integrated
Del: useless -- https://master.php.net/note/delete/124446/useless
Del: bad code -- https://master.php.net/note/delete/124446/bad+code
Del: spam -- https://master.php.net/note/delete/124446/spam
Del: non-english -- https://master.php.net/note/delete/124446/non-english
Del: in docs -- https://master.php.net/note/delete/124446/in+docs
Del: other reasons-- https://master.php.net/note/delete/124446
Reject -- https://master.php.net/note/reject/124446
Search -- https://master.php.net/manage/user-notes.php