Home >Backend Development >PHP Tutorial >Sixth grade Chinese courseware for the first volume of PHP upload file type judgment function to avoid upload loopholes

Sixth grade Chinese courseware for the first volume of PHP upload file type judgment function to avoid upload loopholes

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-29 08:43:011237browse

Copy the code The code is as follows:


function ($file_name,$pass_type=array('jpg','jpeg','gif','bmp','png')){
$yx_file = $ pass_type;
$kzm = substr(strrchr($file_name,"."),1);
$is_img = in_array(strtolower($kzm),$yx_file);
if($is_img){
return true;
} else{
return false;
}
}

The above introduces the PHP upload file type judgment function to avoid upload loopholes in the Chinese courseware for the sixth grade, volume one, including the contents of the Chinese courseware for the sixth grade, volume one. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
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