Just before few days, while working with a form, we required to validate email address.
To satisfy our requirement, we have searched the web and find a “filter_var()” function.
And to validate email address using “filter_var()” function, we have passed two arguments in it.
Where first argument is an email address and second is a type of filter.
The above code returns email address on success and returns false if the given email address is not proper.
Hope this will help you.