roles as $role){ if(!in_array($role, $allowed) || in_array($role, $notallowed)) { $valid=FALSE; } } return $valid; ?>