Menu
Samaritan's Purse

FILTER_HAS_VAR

Checks if variable of specified type exists

SYNTAX

filter_has_var ( int $type , string $variable_name ) : bool

PARAMETERS

type

One of INPUT_GET, INPUT_POST, INPUT_COOKIE, INPUT_SERVER, or INPUT_ENV.

variable_name

Name of a variable to check.

RETURN

Returns TRUE on success or FALSE on failure.

EXAMPLES

INPUT_GET

false

INPUT_POST

false

INPUT_COOKIE

false

INPUT_SERVER

false

INPUT_ENV

false

PHP