题目内容
请写一个函数验证电子邮件的格式是否正确
提问人:蔡爱秀发布时间:2019-08-23
解析:<pre ><code class=function checkEmail($email) { $pregEmail = "/([a-z0-9]*[-_/.]?[a-z0-9]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+[/.][a-z]{2,3}([/.][a-z]{2})?/i"; return preg_match($pregEmail,$email); }"php hljs">function checkEmail($email) { $pregEmail = "/([a-z0-9]*[-_/.]?[a-z0-9]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+[/.][a-z]{2,3}([/.][a-z]{2})?/i"; return preg_match($pregEmail,$email); }</code></pre>
点击加载更多评论>>