A single input type= "file" form is also available for uploading multiple images.
The code is as follows:
<form action= "manypic.php" method= "post" enctype= "Multipart/form-data" >
<input type= "File" Name= "manypic[]" multiple>
<input type= "Submit" >
</form>
Here to add a multiple property to the file form multiple= "multiple" can also
After the property value of name, add [] so that Print_r ($_files) can get the following information:
Array([Manypic] = = Array([name] = = Array([0] = 1.png[1] = Bg.jpg)[Type] = = Array([0] = Image/png[1] = Image/jpeg) [tmp_name]/= Array ( [0] = D:\xampp\tmp\php8C53.tmp [1] = D:\xampp\tmp \php8c54.tmp ) [ERROR] + Array ( [0] = 0 [1] = 0 ) [size ] = = Array ( [0] = 44113 [1] = 325257 ) ) )
Here I upload two pictures Alternatively you can submit multiple input type= "file" upload fields with the following code:
<form action= "manypic.php" method= "POST" Enctype= "Multipart/form-data";
<input type= "file" name= "Pic1" >
<input type= "file" Name= "Pic2";
<input type= "Submit";
</form>
Print results for print_r PHP page:
array ( [Pic1] = Array ( [type] = Image/jpeg [tmp_name] = D:\xampp\tmp\php F661.tmp [ERROR] = 0 [size] = 325257) < Span id= "Line12" > [Pic2] = Array ( [name] = 1.png [type] = > Image/png [tmp_name] = D:\xampp\tmp\phpf671.tmp [ERROR] = 0 [size] = 44113)
Input type= "file" multi-image upload