roles as $role){ if(in_array($role, $notallowed)) { $valid=FALSE; } } // If no roles were hit that aren't allowed, this will still be true. Otherwise it will be false. return $valid; ?>