PHP’s filter functions can be used for validation or sanitizing. These filters are used for validation. This means it will let you know whether or not the data meets the requirements as defined by the filter used.

ID Options Flags
FILTER_VALIDATE_BOOLEAN FILTER_NULL_ON_FAILURE
FILTER_VALIDATE_IP FILTER_FLAG_IPV4, FILTER_FLAG_IPV6, FILTER_FLAG_NO_PRIV_RANGE, FILTER_FLAG_NO_RES_RANGE
FILTER_VALIDATE_URL FILTER_FLAG_PATH_REQUIRED, FILTER_FLAG_QUERY_REQUIRED
FILTER_VALIDATE_EMAIL
FILTER_VALIDATE_FLOAT decimal FILTER_FLAG_ALLOW_THOUSAND
FILTER_VALIDATE_INT min, max FILTER_FLAG_ALLOW_OCTAL, FILTER_FLAG_ALLOW_HEX
FILTER_VALIDATE_REGEXP regular expression

FILTER_VALIDATE_BOOLEAN: Returns TRUE for “1″, “true”, “on” and “yes”. Returns FALSE otherwise. If FILTER_NULL_ON_FAILURE is set, FALSE is returned only for “0″, “false”, “off”, “no”, and “”, and NULL is returned for all non-boolean values.

FILTER_VALIDATE_INT: You may optionally specify a range.

FILTER_VALIDATE_IP:Optional flags to specify IPv4 only, IPv6 only, not from private range, or not from reserved ranges.

FILTER_VALIDATE_URL: Optional flags to specify required components of the url.