您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php email检测类(附示例)

2025/4/9 11:33:24发布17次查看
分享一个php实现的email检测类,同样是用到了php正则,简单实用,有需要的朋友参考下。php实现的email检测类,判断email格式的正确性。
代码:
success_txt=$success_txt; $this->error_txt=$error_txt; } function start_check($params){ $this->email=$params; if(preg_match($this->exp, $this->email)){ return $this->echo_result($this->email,true); /*输入的email格式有效*/ }else{ return $this->echo_result($this->email,false); /*输入的email格式无效*/ } } function echo_result($email,$result){ if($result){ return $email. [.$this->success_txt.]
; }else{ return .$email. [.$this->error_txt.]
; } } } ?>
调用示例:
[如果email格式有效] [如果email格式无效] */ $a->result_txt(email格式有效,email格式无效); echo $a->start_check($email_1); echo $a->start_check($email_2); ?>
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product