No, my code gives exactly what you want. Your input must be malformed.
You said the input was
PHP Code:
Array
(
[file] => Array
(
[name] => Around the Shoreline of Plymouth01.jpg
[type] => image/jpeg
[tmp_name] => C:wamptmpphp7FC5.tmp
[error] => 0
[size] => 258246
)
)
So, when I translate this out into PHP to simulate the input:
PHP Code:
<?php
$_FILES = array('file' => array('name' => "Around the Shoreline of Plymouth01.jpg",'type' => 'image/jpeg','tmp_name' => 'C:wamptmpphpAB90.tmp','error' => 0,'size' => 258246));
$values = array_values($_FILES['file']);
foreach(array_keys($_FILES['file']) AS $index => $key) {
$out['file'][$key][0] = $values[$index];
}
print_r($out);
?>
I get:
Code:
Array
(
[file] => Array
(
[name] => Array
(
[0] => Around the Shoreline of Plymouth01.jpg
)
[type] => Array
(
[0] => image/jpeg
)
[tmp_name] => Array
(
[0] => C:wamptmpphpAB90.tmp
)
[error] => Array
(
[0] => 0
)
[size] => Array
(
[0] => 258246
)
)
)
Which is exactly what you asked for.
Bookmarks