Posted By


openone on 09/18/12

Tagged


Statistics


Viewed 696 times
Favorited by 0 user(s)

Restructure+$_FILES+array


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. foreach ($_FILES as $key_ => $file) {
  2. foreach ($file as $key => $data) {
  3. foreach ($data as $model => $fields) {
  4. if (is_array($fields)) {
  5. foreach ($fields as $field => $value) {
  6. if (is_array($value)) {
  7. foreach ($value as $k => $v) {
  8. $files[$key_][$model][$field][$k][$key] = $v;
  9. }
  10. } else {
  11. $files[$key_][$model][$field][$key] = $value;
  12. }
  13. }
  14. } else {
  15. $files[$key_][$model][$key] = $fields;
  16. }
  17. }
  18. }
  19. }
  20.  
  21. echo '<pre>';
  22. var_export($files);
  23. echo '</pre>';

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.