时间:2021-07-01 10:21:17 帮助过:26人阅读
- <html>
- <head><title>upload picture more oncetitle>head>
- <body>
- <form action="" method="post" enctype="multipart/form-data">
- <p>Pictures:<br />
- <input type="file" name="pictures[]" /><br />
- <input type="file" name="pictures[]" /><br />
- <input type="file" name="pictures[]" /><br />
- <input type="submit" name="upload" value="Send" />
- p>
- form>
- body>
- html>
- php
- if($_POST['upload']=='Send'){
- $dest_folder = "picture/";
- if(!file_exists($dest_folder)){
- mkdir($dest_folder);
- }
- foreach ($_FILES["pictures"]["error"] as $key => $error) {
- if ($error == UPLOAD_ERR_OK) {
- $tmp_name = $_FILES["pictures"]["tmp_name"][$key];
- $name = $_FILES["pictures"]["name"][$key];
- $uploadfile = $dest_folder.$name;
- move_uploaded_file($tmp_name, $uploadfile);
- }
- }
- }
- ?>
以上代码就是PHP批量上传图片的全部编程,希望对有需要的同学有所帮助。
http://www.bkjia.com/PHPjc/446392.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/446392.htmlTechArticle大家可以通过下面这一段代码,来具体了解PHP批量上传图片的具体方式。我们在学习 PHP批量上传图片的代码如下: html head title uploadpictur...