Home / PHP Tips Generated By ChatGPT / 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!"; }