我只是让它工作,然后我以为我已经完成并且它停止工作了。如果文件不是图像,我正试图让它排除错误。这是我正在谈论的那篇文章。任何帮助将不胜感激
$type_array = array('image/jpeg', 'image/gif', 'image/png','image/x-png'); //image types allowed
if(isset($_FILES['images'][$i]) and $_FILES['images']['name'][$i] != '') { //check image
if ($_FILES['images']['size'][$i] < 10240000) { //make sure file is larger than 10mb
$type = $_FILES['images']['type'][$i]; //get the file types
if (!in_array($type, $type_array)) { //make sure the images are allowed
$errors[] = "Please check that you are uploading an image.";
$show_errors = 'show';
exit;
}
} else {
$errors[] = "Please make sure each file is less than 10MB.";
$show_errors = 'show';
exit;
}
} //image checked