php抓取网页中邮箱地址案例

学什么抓取网页中邮箱地址

<?PHP
    / **
    说明:采集网页中的邮箱的代码
    * /
    $ URL =的 'https://www.bdqnhyq.com'; //要采集的网址
    $含量=的file_get_contents($网址);
    // echo $ content;
    函数getEmail($ str){
    // $ pattern =“/([a-z0-9]*[-_\.]?[a-z0-9]+)*@([a-z0-9]*[-_]?[[ -z0-9] +)+ [\] [AZ] {2,3}([\] [AZ] {2})/ I“。?;
    $ pattern =“/([a-z0-9\-_\.]+@[a-z0-9]+\.[a-z0-9\-_\.]+)/”;
    preg_match_all($图案,$ STR,$ emailArr);
 
    返回$ emailArr [0];
    }
    print_r(getEmail($ content));
    ?>

猜你喜欢

转载自blog.csdn.net/dandan520520/article/details/80202636