The filter_input() function gets an external variable (e.g. from form input) and optionally filters it.This function is used to validate variables from insecure sources, such as user input.Check if the external variable "email" is sent to the PHP page, through the "get" method,filter_input — Gets a specific external variable by name and optionally filters it.
mixed filter_input ( int $type , string $variable_name [, int $filter = FILTER_DEFAULT [, mixed $options ]] )
Parameter | Description |
---|---|
type | One of INPUT_GET, INPUT_POST, INPUT_COOKIE, INPUT_SERVER, or INPUT_ENV |
variable_name | Name of a variable to get |
filter | If omitted, FILTER_DEFAULT will be used, which is equivalent to FILTER_UNSAFE_RAW. This will result in no filtering taking place by default |
options | Associative array of options or bitwise disjunction of flags. If filter accepts options, flags can be provided in "flags" field of array |