: This article mainly introduces php basic exercises-multifile Upload. For more information about PHP tutorials, see.
Index_uploadsIndex_uploads.php
"; Print_r ($ _ FILES); echo"
"; $ Count = count ($ _ FILES ['file'] ['name']); for ($ I = 0; $ I <$ count; $ I ++) {$ tmpfile = $ _ FILES ['file'] ['tmp _ name'] [$ I]; $ filefix = array_pop (explode (". ", $ _ FILES ['file'] ['name'] [$ I]); $ dstfile =" uploads/files /". time (). "_". mt_rand (). ". ". $ filefix; if (move_uploaded_file ($ tmpfile, $ dstfile) {echo "script" alert ('succeed! '); Window. location. href = 'index _ uploads. php'; script ";} else {echo" script "alert ('Fail! '); Window. location. href = 'index _ uploads. php'; script ";}} uploads. php
The above describes the basic php exercises-multifile Upload, including the content, and hope to be helpful to friends who are interested in PHP tutorials.