<form enctype="multipart/form-data" method="post" action="upload.php""> <input type="file" name="id_pic[]" accept="image/*" class="form-control" multiple /> <input type="submit" value="上传 " /> </form>
<form enctype="multipart/form-data" method="post" action="upload.php""> <input type="file" name="id_pic_1" accept="image/*" class="form-control" /> <input type="file" name="id_pic_2" accept="image/*" class="form-control" /> <input type="submit" value="上传 " /> </form>
array(1) {
["id_pic"] => array(5) {
["name"] => array(2) {
[0] => string(5) "1.jpg"
[1] => string(5) "2.jpg"
}
["type"] => array(2) {
[0] => string(10) "image/jpeg"
[1] => string(10) "image/jpeg"
}
["tmp_name"] => array(2) {
[0] => string(27) "C:\Windows\Temp\php7A7E.tmp"
[1] => string(27) "C:\Windows\Temp\php7A7F.tmp"
}
["error"] => array(2) {
[0] => int(0)
[1] => int(0)
}
["size"] => array(2) {
[0] => int(77357)
[1] => int(56720)
}
}
}
array(2) {
["id_pic_1"] => array(5) {
["name"] => string(5) "1.jpg"
["type"] => string(10) "image/jpeg"
["tmp_name"] => string(27) "C:\Windows\Temp\phpBBEE.tmp"
["error"] => int(0)
["size"] => int(77357)
}
["id_pic_2"] => array(5) {
["name"] => string(5) "2.jpg"
["type"] => string(10) "image/jpeg"
["tmp_name"] => string(27) "C:\Windows\Temp\phpBBEF.tmp"
["error"] => int(0)
["size"] => int(56720)
}
}
function dealFiles($files) {
$fileArray = array();
$n = 0;
foreach ($files as $key=>$file){
if(is_array($file['name'])) {
$keys = array_keys($file);
$count = count($file['name']);
for ($i=0; $i<$count; $i++) {
$fileArray[$n]['key'] = $key;
foreach ($keys as $_key){
$fileArray[$n][$_key] = $file[$_key][$i];
}
$n++;
}
}else{
$fileArray = $files;
break;
}
}
return $fileArray;
}
//php示例: $img = base64_decode($_POST['img']); $img = imagecreatefromstring($img);
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有