...

View Full Version : Resolved Counting an array



RonnyNishimoto
07-18-2012, 12:22 AM
$allowed = array("jpg", "jpeg", "gif", "png");
if ($_FILES["file"]["type"] == "images/"(for(i = 0; i < count($allowed); i++))) {

}
else {}


How would I make this work? It would be "images/(each file type in the array)".

firepages
07-18-2012, 12:53 AM
this would probably be easier ?


$allowed = array("images/jpg", "images/jpeg", "images/gif", "images/png");
if(in_array($_FILES["file"]["type"],$allowed)){
//all good
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum