Hello,
I have script for multiple file uploads. Im trying to iterate through the array fiels to separate the "name" the the "tmp_name" from the array. I tried different variations with the foreach loop and I'm not getting the results i'm looking to get.
Results I like to receive:
orange.jpg /tmp/phpvvodB8
postproject.jpg /tmp/php9pDM36
Array: $testArray = $_FILES['data'];
result:
array(5) { ["name"]=> array(2) { [0]=> string(10) "orange.jpg" [1]=> string(15) "postproject.jpg" } ["type"]=> array(2) { [0]=> string(10) "image/jpeg" [1]=> string(10) "image/jpeg" } ["tmp_name"]=> array(2) { [0]=> string(14) "/tmp/phpvvodB8" [1]=> string(14) "/tmp/php9pDM36" } ["error"]=> array(2) { [0]=> int(0) [1]=> int(0) } ["size"]=> array(2) { [0]=> int(13748) [1]=> int(4511) } }
foreach($testArray as $key1 => $value1)
{ foreach($value1 as $key2 => $value2)
{ echo "<br> found " . $value2; }
}
any help you can provide would be greatly appreciated