Zend_Validate_EmailAddress versus filter_var(..., FILTER_VALIDATE_EMAIL)
Asked Answered
R

1

6

Of Zend_Validate_EmailAddress and filter_var(..., FILTER_VALIDATE_EMAIL), which is better when validating an email address and why?

Reopen answered 21/7, 2011 at 14:30 Comment(0)
L
6

Both can be used to validate an email address, but Zend_Validate_EmailAddress is more powerful. While filter_var is a simple yes or no validator, there are many options which can change how strict Zend_Validate_EmailAddress is.

You can choose which parts to validate, rules for validating those parts, and even to validate MX records.

Finally, Zend_Validate_EmailAddress can be readily used in combination with Zend_Filter_Input and Zend_Form where filter_var can't.

Lubumbashi answered 21/7, 2011 at 14:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.