filter_has_var()

It can be used to check whether a variable of specified input type exists

General Format

filter_has_var(type, variable)

type – Possible types and can be one of the followings

*) INPUT_COOKIE
*) INPUT_GET
*) INPUT_ENV
*) INPUT_POST
*) INPUT_SERVER

variable – hold the value to be checked

Example
=======

<?php
if(!filter_has_var(INPUT_GET, “email”)){
echo(“Does not exist”);
}else {
echo(“Exists”);
}
?>

Leave a Reply

Your email address will not be published. Required fields are marked *