标签:turn limit ble nav ffd https global 字符 asd
<?php //获取随机英文字符串 function getNickname($length){ $strs="QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm"; $name=substr(str_shuffle($strs),mt_rand(0,strlen($strs)-11),$length); return $name; } //设置超时时间 set_time_limit(3600); ini_set(‘memory_limit‘, ‘1024M‘); //链接数据库 $pdo = new PDO(‘mysql:host=127.0.0.1;dbname=1703a‘,‘root‘,‘root‘); //sql前半部分 $sql = ‘insert into user (username,nickname,fname,create_at) values ‘; //循环拼接 for($i=1;$i<=100000;$i++){ $nickname = getNickname(6); $fname = getNickname(10); $sql .= "(‘".$i."email@qq.com‘,‘".$nickname."‘,‘".$fname."‘,‘".time()."‘),"; } //去掉多余的逗号 $last_sql = substr($sql, 0, -1); // echo $last_sql; //最终的sql $pdo->exec($last_sql);
标签:turn limit ble nav ffd https global 字符 asd
原文地址:https://www.cnblogs.com/jiangshiguo/p/11067738.html