Easy Tutorial
❮ Func String Substr Compare Func Date Gettimeofday ❯

PHP filter_has_var() Function



Definition and Usage

The filter_has_var() function checks if a variable of the specified input type exists.

It returns TRUE on success and FALSE on failure.

Syntax

Parameter Description
type Required. Specifies the type to check. Possible input types: INPUT_GET<br> INPUT_POST<br> INPUT_COOKIE<br> INPUT_SERVER<br> INPUT_ENV
variable Required. Specifies the variable to check.

Example

In this example, the input variable "name" is sent to the PHP page:

The output of the code is as follows:


❮ Func String Substr Compare Func Date Gettimeofday ❯