PHP filter_input() Function

PHP filter_input Function


Define :

In this tutorial we have learned about PHP filter_input() Function.The filter_input() function is inbuilt function in php.This function is used to gets a specific external variable by name and optionally filters it.

Syntax
  filter_input(type, var_name, filter, options)

Parameters

type Required. Specify the input type. It can be one of the following:
  • INPUT_GET
  • INPUT_POST
  • INPUT_COOKIE
  • INPUT_SERVER
  • INPUT_ENV
var_name Required. Specify the variable name to check.

Given below example to shows the PHP filter_input() Function :

Output :