function fp_re_array_files
Search API
7.x misc.inc | fp_re_array_files($file_post) |
6.x misc.inc | fp_re_array_files($file_post) |
Re-order the _FILES array for multiple files, to make it easier to work with. From: http://php.net/manual/en/features.file-upload.multiple.php
To use: $myfiles = fp_re_array_files($_FILES['fieldname'])
5 calls to fp_re_array_files()
- content_edit_content_form_submit in modules/
content/ content.module - Submit handler for the edit content form.
- content_edit_content_form_validate in modules/
content/ content.module - content_public_files_form_submit in modules/
content/ content.module - student_files_handle_upload in modules/
student_files/ student_files.module - Handles the upload of a file which we assume is located at $_FILES["student_file_upload_file"], or the provided $file array.
- student_files_upload_any_student_files_form_validate in modules/
student_files/ student_files.module - Validate function.
File
- includes/
misc.inc, line 254 - This file contains misc functions for FlightPath
Code
function fp_re_array_files($file_post) {
$file_ary = array();
$file_count = count($file_post ['name']);
$file_keys = array_keys($file_post);
for ($i = 0; $i < $file_count; $i++) {
foreach ($file_keys as $key) {
$file_ary [$i][$key] = $file_post [$key][$i];
}
}
return $file_ary;
}