php replace this code plz?

Creq Du Freak

New member
<?php
$blacklist = array(".php", ".phtml", ".php3", ".php4");


foreach($blacklist as $item){
if(preg_match("/$item\$/i", $_FILES["userfile"]["name"])){
echo "we do not accept php files" ;
exit;
}
}

?>

i want to use this code inside
<?php
elseif(preg .....) { //if its true
echo "somethin";
exit;
}
?>
i want to remove foreach but wants the same result its fo security pur[pose
i am letting user upload file but i want it to be checked through each code if(){}elsif{}. . . .
 
Back
Top