建立email.php

<?php
    header('content-type:text/html;charset=UTF-8');
    $link = mysqli_connect("localhost","root","123456","exam","3306");
    $sql = "set names utf8";
    $sql = "select * from user_user";
    $re = mysqli_query($link,$sql);
    while($arr = mysqli_fetch_assoc($re)){
        $data[] = $arr;
    }
    if ($data=='') {
        echo "<script>alert('为空');</script>";
    }else{
        foreach($data as $key=>$v){
            $ema=ltrim(strstr($v['email'],'@'),"@");
            $email[$ema][]=$ema;
        }
    }
    // print_r($data);


    ?>

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>邮箱</title>
    </head>
    <body>
        <?php foreach($email as $key=>$v){ ?>
        <?php echo $key; ?>的邮箱<?php echo count($v); ?>个<br/>
        <?php } ?>

    </body>
    </html>

代码仅供参考。。。关键看思路

相关文章:

  • 2021-12-02
  • 2021-11-17
  • 2021-10-29
  • 2022-02-07
  • 2021-10-19
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-12
  • 2021-09-12
  • 2021-12-27
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
  • 2022-01-28
相关资源
相似解决方案