时间:2021-07-01 10:21:17 帮助过:19人阅读
$url='http://www.gxlcms.com'; //这个网页里绝对含有邮件地址。
$content=file_get_contents($url);
//echo $content;
function getEmail($str) {
//$pattern = "/([a-z0-9]*[-_\.]?[a-z0-9]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+[\.][a-z]{2,3}([\.][a-z]{2})?/i";
$pattern = "/([a-z0-9\-_\.]+@[a-z0-9]+\.[a-z0-9\-_\.]+)/";
preg_match_all($pattern,$str,$emailArr);
return $emailArr[0];
}
print_r( getEmail($content));
?>
http://www.bkjia.com/PHPjc/325632.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/325632.htmlTechArticle 代码如下:
?php $url='http://www.gxlcms.com'; //这个网页里绝对含有邮件地址。 $content=file_get_contents($url); //echo $content; function getEmail($str)...