有人能告诉我为什么,在选择 psd 文件时,php 代码中的 if 语句传递为 true 并回显“image/vnd.adobe.photoshop”吗?
<?php
if (isset($_POST['submit'])) {
foreach ($_FILES["myimages"]["error"] as $key => $error) {
$tmp_name = $_FILES["myimages"]["tmp_name"][$key];
$name = $_FILES["myimages"]["name"][$key];
$imagetype = $_FILES['myimages']['type'][$key];
if ($imagetype == "image/jpeg" || "image/gif") {
echo $imagetype;
}
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<form method="post" enctype="multipart/form-data" action="<? echo basename(__file__); ?>">
<input type="file" name="myimages[]" multiple>
<input name="submit" type="submit" value="submit">
</form>
</body>
</html>