a name file in multiple upload

See all posts Reply

a name file in multiple upload new!
by darteye, 12 years, 10 months ago
how can I pull the file name of the foreach?

$files = array();          
foreach ($_FILES['my_field'] as $k => $l) {  
  foreach ($l as $i => $v) {    
    if (!array_key_exists($i, $files))       
      $files[$i] = array();    
    $files[$i][$k] = $v; 
    echo $l;
  }
}
// we now remove invalid entries for non-uploaded images
foreach ($files as $k => $v) {  
  if ($v['error'] != 0) unset($files[$k]);
}

$uploaded = array();
  
foreach (array_keys($files) as $k) { 
  //-> here name of image
}
Reply
Re: a name file in multiple upload new!
by colin, 12 years, 10 months ago
I am not sure what you mean. But if you want to find the filename from the array $files, then just do this to see how your array is formed:
print_r($files);
Reply
Re: a name file in multiple upload new!
by darteye, 12 years, 10 months ago
I want only the name of file, how can I draw out the name of the image from print_r($files); and save the name in mysql base?Reply