根据一个人的姓氏随机生成几个人的名字

        $name5= mb_substr('袁斯强', 0,1,'utf-8');
        $ab=array("忠","少","小","斯","钦","义","仁","泉","仕","国","广","良","早","春","和","尚","节","高","祥","文","方","应","屯","旭","浪","宇","信","本","毛");
        $ab2=array("华","毛","德","平","清","辉","强","云","保","坤","发","贵","水","如","元","贵","荣","根","亮","才","新","成","洪","庆","勇","财","进","斌","彬","兵");
        
        $rand_keys1  = array_rand($ab,2);
        $rand_keys2  = array_rand($ab2,2);
        
        $rand_keys3  = array_rand($ab,2);
        $rand_keys4  = array_rand($ab2,2);
        
        $rand_keys5  = array_rand($ab,2);
        $rand_keys6  = array_rand($ab2,2);
        
        $rand_keys7  = array_rand($ab,2);
        $rand_keys8  = array_rand($ab2,2);
        
        $name1= $name5.$ab[$rand_keys1[0]].$ab2[$rand_keys2[1]];
        $name2= $name5.$ab[$rand_keys3[1]].$ab2[$rand_keys4[0]];
        $name3= $name5.$ab[$rand_keys5[0]].$ab2[$rand_keys6[1]];
        $name4= $name5.$ab[$rand_keys7[1]].$ab2[$rand_keys8[0]];
        echo $name1."</p>".$name2."</p>".$name3."</p>".$name4;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值