<?php class create_nam{ /** * 随机生用户名 * */ public function create_company_nameOp(){ //名称单词池 $dictionary = array("INTERNATIONAL","P&E","A&O","LOC"); //姓氏池 $country = array("china|142","UK|502"); //定义循环次数 $create_num = isset($_GET['create_num'])?(int)$_GET['create_num']:100; $model_company_list_typec = Model("company_list_typec"); while ( $create_num > 0) { //字节长度,随机1-6名 $long = rand(1,6); $name = array(); for ($i=0; $i < $long; $i++) { $item = array_rand($dictionary); if(!in_array($item,$name)){ $name[] = $item; } } $name = implode(" ", $name); $country_code = explode("|",array_rand($country)); $name .= $country_code[0]; $cond['company_name'] = $name; $res = $model_company_list_typec->getOneCompanyListTypeC($cond); if(empty($res)){ $data = array(); $data['company_name'] = $name; $data['country_code'] = $country_code[1]; $data['send_type'] = 2; $data['company_type'] = 1; //保存名称 $re = $model_company_list_typec->addCompanyListTypeC($data); if($re){ //循环出口 $create_num = $create_num - 1; } } } showMessage("succ");exit; } } ?>
宠物免费领养小程序,欢迎来踩