Home > Backend Development > PHP Tutorial > php-我用in_array 检查数组中是否有某个值但总是报错,不知道是怎么回事!

php-我用in_array 检查数组中是否有某个值但总是报错,不知道是怎么回事!

WBOY
Release: 2016-06-02 11:33:17
Original
1262 people have browsed it

phpjavascript

$tp = array("image/gif","image/pjpeg","image/jpeg","image/png" );

if( ! in_array($_FILES["pictures"]["type"][$key],$tp))

<code>{     echo "<script language="javascript">";    echo "alert(\"文件类型错误! \")";   echo "</script>";   </code>
Copy after login

}
当上传mp3文件时有的能执行alter()而有的却不行,不知道到底为什么!!!
例子:当mp3名字为:-The Girl Is Mine Ft Brandy Monica (Remix).mp3就检测不出来
而当名字为:Family Conference.mp3时却能执行alert()
觉得很莫名其妙!!!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template