<?php
if(isset($_FILES['files']['name']))
{
foreach($_FILES['files']['name'] as $key)
{
echo $file_name = $_FILES['files']['name'][$key];
}
}
?>
<form action="test.php" method="POST" enctype="multipart/form-data">
<input type="file" name="files[]" multiple />
<input type="submit" value="submit">
</form>
I want to echo the file names. But i got error
Notice: Undefined index: 1_t.jpg in D:\xampp1\htdocs\imageupload\test.php on line 6
Notice: Undefined index: 2_t.jpg in D:\xampp1\htdocs\imageupload\test.php on line 6
Notice: Undefined index: 007.jpg in D:\xampp1\htdocs\imageupload\test.php on line 6
This should work