if (count($_FILES)){ foreach($_FILES as $k=>$v){ if (preg_match(',^fichier_\d+$,',$k) AND preg_match(',[.]php,i',$v['name'])) unset($_FILES[$k]); } }