Programming Languages PHP Objective
Sep 23, 2025

Which PHP function is used to validate and sanitize email addresses?

Choose the correct answer:
A) filter_var() with FILTER_VALIDATE_EMAIL
B) validate_email()
C) is_email()
D) check_email()
Detailed Explanation

Explanation: filter_var($email, FILTER_VALIDATE_EMAIL) validates email addresses according to RFC standards. For sanitization, use FILTER_SANITIZE_EMAIL to remove invalid characters.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback