Heya folks!
I'm utilizing Verot's upload class and it's asking me to run the following foreach on the upload array before handling it. This same nested foreach loop exists on their demo page and is operating as intended, but when I use it to populate my $files array, it posts 5 duplicate errors for the same line.
$files = array();
foreach ($_FILES['ci_image'] as $k => $l) {
foreach ($l as $i => $v) {
if (!array_key_exists($i, $files))
$files[$i] = array();
$files[$i][$k] = $v;
}
}
Which is resulting in the following error:
Invalid argument supplied for foreach()
A vardump of my files array the following:
array(5) {
["name"]=>
string(5) "0.png"
["type"]=>
string(9) "image/png"
["tmp_name"]=>
string(14) "/tmp/php6ywAIJ"
["error"]=>
int(0)
["size"]=>
int(1436)
}
Could anyone tell me why this is resulting in an error and how I might resolve the issue?
Thanks a bunch!