note 125035 added to features.file-upload.multiple

From: Date: Fri, 22 May 2020 17:10:45 +0000
Subject: note 125035 added to features.file-upload.multiple
Groups: php.notes 
Request: Send a blank email to php-notes+get-214663@lists.php.net to get a copy of this message
A bit update to 14 year ago note from "phpuser at gmail dot com". That update converts to a really more friendly array form incoming _POST info for uploaded files. And that variants works identical for non-multiple uploads and multiple uploads: <?php //Функция переформатирует массив поданных POST'ом файлов function reArrayFiles(&$file_post){ $isMulti = is_array($file_post['name']); $file_count = $isMulti?count($file_post['name']):1; $file_keys = array_keys($file_post); $file_ary = []; //Итоговый массив for($i=0; $i<$file_count; $i++) foreach($file_keys as $key) if($isMulti) $file_ary[$i][$key] = $file_post[$key][$i]; else $file_ary[$i][$key] = $file_post[$key]; return $file_ary; } ?> ---- Server IP: 45.112.84.4 Probable Submitter: 103.51.166.36 (proxied: 212.220.105.222) ---- Manual Page -- http://php.net/manual/en/features.file-upload.multiple.php Edit -- https://master.php.net/note/edit/125035 Del: integrated -- https://master.php.net/note/delete/125035/integrated Del: useless -- https://master.php.net/note/delete/125035/useless Del: bad code -- https://master.php.net/note/delete/125035/bad+code Del: spam -- https://master.php.net/note/delete/125035/spam Del: non-english -- https://master.php.net/note/delete/125035/non-english Del: in docs -- https://master.php.net/note/delete/125035/in+docs Del: other reasons-- https://master.php.net/note/delete/125035 Reject -- https://master.php.net/note/reject/125035 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#214663) next »