Federico Cargnelutti

Simple is better than complex. Complex is better than complicated. | @fedecarg

Data filtering using PHP’s filter functions

leave a comment »

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.

Data Filtering Using PHP’s Filter Functions

Written by Federico

September 11, 2008 at 10:07 pm

Posted in PHP, Programming, Security

Leave a Reply