php 檢查電子郵件函數(shù)(自寫)
更新時間:2014年01月16日 17:59:24 作者:
檢查電子郵件的工作對于一些注冊類的網(wǎng)站來說非常有必要,下面有個不錯的函數(shù),大家可以參考下
復(fù)制代碼 代碼如下:
function is_valid_email_address($email){
$qtext = '[^//x0d//x22//x5c//x80-//xff]';
$dtext = '[^//x0d//x5b-//x5d//x80-//xff]';
$atom = '[^//x00-//x20//x22//x28//x29//x2c//x2e//x3a-//x3c'.
'//x3e//x40//x5b-//x5d//x7f-//xff]+';
$quoted_pair = '//x5c[//x00-//x7f]';
$domain_literal = "http://x5b($dtext|$quoted_pair)*//x5d";
$quoted_string = "http://x22($qtext|$quoted_pair)*//x22";
$domain_ref = $atom;
$sub_domain = "($domain_ref|$domain_literal)";
$word = "($atom|$quoted_string)";
$domain = "$sub_domain(//x2e$sub_domain)*";
$local_part = "$word(//x2e$word)*";
$addr_spec = "$local_part//x40$domain";
return preg_match("!^$addr_spec$!", $email) ? 1 : 0;
}
相關(guān)文章
實現(xiàn) win2003 下 mysql 數(shù)據(jù)庫每天自動備份
這篇文章主要為大家介紹下,如果用批處理實現(xiàn)mysql的自動備份,需要的朋友可以參考下2006-12-12PHP配合fiddler抓包抓取微信指數(shù)小程序數(shù)據(jù)的實現(xiàn)方法分析
這篇文章主要介紹了PHP配合fiddler抓包抓取微信指數(shù)小程序數(shù)據(jù)的實現(xiàn)方法,結(jié)合實例形式分析了PHP結(jié)合fiddler抓取微信指數(shù)小程序數(shù)據(jù)的相關(guān)原理與實現(xiàn)方法,需要的朋友可以參考下2020-01-01