Using filter_input() for Input Validation and Sanitization in PHP


Retrieve and sanitize user input from GET or POST data.

Source Code

$email = filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL);
if ($email === false) {
    echo "Invalid email!";
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments