Return to Snippet

Revision: 59571
at September 18, 2012 21:37 by openone


Initial Code
foreach ($_FILES as $key_ => $file) {
	foreach ($file as $key => $data) {
		foreach ($data as $model => $fields) {
			if (is_array($fields)) {
				foreach ($fields as $field => $value) {
					if (is_array($value)) {
						foreach ($value as $k => $v) {
							$files[$key_][$model][$field][$k][$key] = $v;
						}
					} else {
						$files[$key_][$model][$field][$key] = $value;
					}
				}
			} else {
				$files[$key_][$model][$key] = $fields;
			}
		}
	}
}
			
echo '<pre>';
var_export($files);
echo '</pre>';

Initial URL

                                

Initial Description

                                

Initial Title
Restructure+$_FILES+array

Initial Tags
textmate

Initial Language
PHP