Improve in_array validation rule.