Filtering data. We all have to do it. Most, if not all of us, despise doing it. However, unbeknown to most are PHP’s filter functions, that allow us to do all sorts of filtering and validation. Using PHP’s filter functions, we can validate and sanitize data types, URLs, e-mail addresses, IP addresses, strip bad characters, and more, all with relative ease.
This is part one of two, covering filter_var() and the different constants and flags that can be set.