php批量上传的实现代码

前端之家收集整理的这篇文章主要介绍了php批量上传的实现代码前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

如下所示:
<div class="codetitle"><a style="CURSOR: pointer" data="62391" class="copybut" id="copybut62391" onclick="doCopy('code62391')"> 代码如下:

<div class="codebody" id="code62391">
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];
$uploadname = getPath('../Public/Upload').time().''.$file_name;
@move_uploaded_file($tmp_name,$upload_name);
$map[$sql] = $file_name;
print_r($map);
exit;
}
}
}

原文链接:https://www.f2er.com/php/26336.html

猜你在找的PHP相关文章