How to use filter has var in PHP

This article describe about filter_has_var() Function in PHP.
  • 1945

filter_has_var() Function

The variable of specified input type exits or not check by the filter_has_var() function.

It is return TRUE on success and FALSE on failure.

Syntax

filter_has_var( type, variable)

 

Parameter Description
type Required. Define the type for check.

possible input type.

  • INPUT_SERVER
  • INPUT_ENV
  • INPUT_GET
  • INPUT_POST
  • INPUT_COOKIE
variable Required. Define the variable for check.

Example

<html>
<body>
<?php
if(!filter_has_var(INPUT_GET, "name"))
{
echo("Input type does not exist");
}
else
{
echo("Input type exists");
}
?>
</body>
</html>

 

Output


pic1.jpg

You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.