Zend_Validate_EmailAddress vs filter_var (..., FILTER_VALIDATE_EMAIL)

Of Zend_Validate_EmailAddress and filter_var(..., FILTER_VALIDATE_EMAIL) , which is better when checking email addresses and why?

+6
source share
1 answer

Both can be used to verify email addresses, but Zend_Validate_EmailAddress is more powerful. Although filter_var is a simple yes or no validator, there are many parameters that can change as strict Zend_Validate_EmailAddress.

You can choose which parts should be checked, rules for checking these parts, and even check MX records.

Finally, Zend_Validate_EmailAddress can be easily used in combination with Zend_Filter_Input and Zend_Form , where filter_var cannot.

+6
source

Source: https://habr.com/ru/post/893277/


All Articles