Collect the php code of the mailbox (capture the email address on the webpage ). Copy the code as follows :? Php $ urlwww.jb51.net; this webpage absolutely contains an email address. $ Contentfile_get_contents ($ url); echo $ content; functiongetEmail ($ str)
The code is as follows:
$ Url = 'http: // www.jb51.net'; // This webpage absolutely contains an email address.
$ 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 ));
?>
The http://www.bkjia.com/PHPjc/325632.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/325632.htmlTechArticle code is as follows :? Php $ url = 'http: // www.jb51.net'; // This webpage absolutely contains an email address. $ Content = file_get_contents ($ url); // echo $ content; function getEmail ($ str )...