It may be better to do the `array_filter()` after sanitizing all the elements, since it's possible that some elements will become empty due to the sanitization.