filter_input()

Read the input from the outside script and filter the same
Genaral Format

filter_input(input_type, variable, filter)

Input_type – a valid input ype

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

variable – Value to be filtered

filter – A valid ID

Example

<?php
if (filter_input(INPUT_POST, ‘url’, FILTER_VALIDATE_URL)) {
echo “Valid URL”;
}else {
echo “Invalid URL”;
}
?>

Share

Leave a Reply

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