標籤:email
/** * 根據郵箱擷取郵箱網址 * @param $email * @return bool|string */ public static function getEmail($email) { $data = array( ‘163.com‘ => ‘mail.163.com‘, ‘vip.163.com‘ => ‘vip.163.com‘, ‘126.com‘ => ‘mail.126.com‘, ‘qq.com‘ => ‘mail.qq.com‘, ‘vip.qq.com‘ => ‘mail.qq.com‘, ‘foxmail.com‘ => ‘mail.qq.com‘, ‘gmail.com‘ => ‘mail.google.com‘, ‘sohu.com‘ => ‘mail.sohu.com‘, ‘tom.com‘ => ‘mail.tom.com‘, ‘vip.sina.com‘ => ‘vip.sina.com‘, ‘sina.com.cn‘ => ‘mail.sina.com.cn‘, ‘sina.com‘ => ‘mail.sina.com.cn‘, ‘yahoo.com.cn‘ => ‘mail.cn.yahoo.com‘, ‘yahoo.cn‘ => ‘mail.cn.yahoo.com‘, ‘yeah.net‘ => ‘www.yeah.net‘, ‘21cn.com‘ => ‘mail.21cn.com‘, ‘hotmail.com‘ => ‘www.hotmail.com‘, ‘sogou.com‘ => ‘mail.sogou.com‘, ‘188.com‘ => ‘www.188.com‘, ‘139.com‘ => ‘mail.10086.cn‘, ‘189.cn‘ => ‘webmail15.189.cn/webmail‘, ‘wo.com.cn‘ => ‘mail.wo.com.cn/smsmail‘, ‘outlook.com‘ => ‘outlook.com‘, ‘mail.dealmoon.com‘ => ‘exmail.qq.com‘, ‘dealmoon.com‘ => ‘www.hotmail.com‘, ); $email_url = substr($email, strpos($email, "@") + 1); $email_url = strtolower($email_url); if (isset($data[$email_url])) { $email_url = $data[$email_url]; } else { $email_url = false; } return $email_url; }
本文出自 “我是IT農民工” 部落格,請務必保留此出處http://lfliangli.blog.51cto.com/2853536/1536058