for($i=0; $i<=count($_FILES['myfile']['name']); $i++)
{
move_uploaded_file($_FILES['myfile']['tmp_name'][$i],"img/".$_FILES['myfile']['name'][$i]); //<!-- Error
$path="img/".$_FILES['myfile']['name'];
}
答案 0 :(得分:1)
我认为这一行很可能是你的问题
$path="img/".$_FILES['myfile']['name']
为其添加索引,就像上一行中对$_FILE
的其他引用一样
for($i=0;$i<=count($_FILES['myfile']['name']);$i++) {
move_uploaded_file($_FILES['myfile']['tmp_name'][$i],"img/".$_FILES['myfile']['name'][$i]);
$path="img/".$_FILES['myfile']['name'][$i]; //<- changed line
}
答案 1 :(得分:1)
将您的路径更改为以下内容:
$path="img/".$_FILES['myfile']['name'][$i];