Silakan lihat, Anda bisa mendapatkan semua ide tentang unggahan gandahttp:// php.net/manual/en/features.file-upload.multiple.php
Lihat contoh di bawah
<?php
print_r($_FILES);
?>
<form action="" method="post" enctype="multipart/form-data">
Send these files:<br />
<input name="userfile[]" type="file" /><br />
<input name="userfile[]" type="file" /><br />
<input type="submit" value="Send files" />
</form>
Lihat Hasil di bawah
Array
(
[userfile] => Array
(
[name] => Array
(
[0] => cancelled booking - PAYG.png
[1] => cancelled booking - PAYG.png
)
[type] => Array
(
[0] => image/png
[1] => image/png
)
[tmp_name] => Array
(
[0] => C:\xampp\tmp\php402A.tmp
[1] => C:\xampp\tmp\php402B.tmp
)
[error] => Array
(
[0] => 0
[1] => 0
)
[size] => Array
(
[0] => 99134
[1] => 99134
)
)
)
Untuk pertanyaan Anda, berikut ini adalah foreach
<?php
foreach ($_FILES['userfile'] as $position => $file){
print_r($file);
}
?>
Kapan Hasilnya Lihat Di Bawah :
Array
(
[0] => cancelled booking - PAYG.png
[1] => cancelled booking - PAYG.png
)
Array
(
[0] => image/png
[1] => image/png
)
Array
(
[0] => C:\xampp\tmp\php284D.tmp
[1] => C:\xampp\tmp\php284E.tmp
)
Array
(
[0] => 0
[1] => 0
)
Array
(
[0] => 99134
[1] => 99134
)
Jadi sekarang Anda bisa mengerti
Terima kasih Pratik