mixed filter_var_array(mixed var[, mixed options])

Performs a series of filters against variables in the specified context and returns the results as an associative array. The context is one of INPUT_GET, INPUT_POST, INPUT_COOKIE, INPUT_SERVER, or INPUT_ENV.

The options parameter is an associative array where each element’s key is a variable name, with the associated value defining the filter and options to use to filter that variable’s value. The definition is either the ID of the filter to use or an array containing one or more of the following elements:


The ID of the filter to apply.


A bitfield of flags.


An associative array of options specific to the filter.

Get Programming PHP, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.