欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php批量上传的实现代码_PHP教程

程序员文章站 2024-04-04 23:52:12
...
如下所示:
复制代码 代码如下:

if (isset($_POST['submit'])) {
foreach($_FILES['product_img']['error'] as $k=>$v){
if ($v == UPLOAD_ERR_OK) {
$sql ='product_img'.($k+1);
$tmp_name = $_FILES['product_img']['tmp_name'][$k];
$file_name = $_FILES['product_img']['name'][$k];
$file_type = $_FILES['product_img']['type'][$k];
$upload_name = getPath('../Public/Upload').time().'_'.$file_name;
@move_uploaded_file($tmp_name,$upload_name);
$map[$sql] = $file_name;
print_r($map);
exit;
}
}
}

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/327522.htmlTechArticle如下所示: 复制代码 代码如下: if (isset($_POST['submit'])) { foreach($_FILES['product_img']['error'] as $k=$v){ if ($v == UPLOAD_ERR_OK) { $sql ='product_img'.($k+1); $...