How to validate an Email in PHP?

后端 未结 7 723
梦毁少年i
梦毁少年i 2020-11-22 05:20

How can I validate the input value is a valid email address using php5. Now I am using this code

function isValidEmail($email){ 
     $pattern = \"^[_a-z0-9         


        
7条回答
  •  北海茫月
    2020-11-22 05:54

    Stay away from regex and filter_var() solutions for validating email. See this answer: https://stackoverflow.com/a/42037557/953833

提交回复
热议问题