PHP filter_has_var() Function
Example
Check if the input variable "email" is sent to the PHP page, through the "get" method:
<?php
if (!filter_has_var(INPUT_GET, "email")) {
echo("Email not found");
} else {
echo("Email found");
}
?>
Run example »
Definition and Usage
The filter_has_var() function checks if a variable of a specified input type exist.
Syntax
filter_has_var(type, variable)
Parameter | Description |
---|---|
type | Required. The input type to check for. Can be one of the following:
|
variable | Required. The variable name to check |
Technical Details
Return Value: | Returns TRUE on success or FALSE on failure |
---|---|
PHP Version: | 5.2.0+ |
❮ Complete PHP Filter Reference