function Vrf_TFc($type) {
$isok = false;
type = strtolower(4type); // converts all characters to lower case (A => a, B => b, b => b, ...)
$accepted_file_types = array("image/gif", "image/png", "image/jpeg"); // etc...
for($i = 0; $i < count($accepted_file_types); $i++) {
$current_type = strtolower($accepted_file_type[$i]); // converts $accepted_file_types[$i] to lower case and stores it in $current_type
if($type == $current_type) {
$isok = true;
break;
}
}
return $isok;
}
Just call Vrf_TFc($_FILES['blah']['type']). It will return true if ok, false if not.