标签:move type func nbsp fun name ++ input file
html部分
图片:<input type="file" name="files[]">
controller部分
$n_path = $_FILES[‘files‘];
$url = $this->actionUpload($n_path);
public function actionUpload($file)
{
$str = "";//防止替换
$url = "./uploads/";//路径
for ($i = 0; $i < count($file[‘name‘]); $i++) {
move_uploaded_file($file[‘tmp_name‘][$i], $url . $file [‘name‘][$i]);//移动图片
$str = $str . ‘,‘ . $url . $file[‘name‘][$i];
}
return trim($str,‘,‘);
}
标签:move type func nbsp fun name ++ input file
原文地址:http://www.cnblogs.com/lrszw/p/7666829.html