php 生成随机字符串
来源:互联网 发布:ubuntu mate 17.10 qq 编辑:程序博客网 时间:2024/05/16 19:46
<?php function generateRandomString($length = 15) { return substr(str_shuffle(str_repeat($x='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', ceil($length/strlen($x)))), 1, $length); } $db = new PDO('mysql:host=127.0.0.1;dbname=random', 'root', 'xxxxxxx'); $stmt = $db->prepare("INSERT INTO random(`random`) VALUES(?);"); for ($i = 0; $i <= 150000; $i++) { $stmt->execute(array(generateRandomString())); }
阅读全文
0 0
- PHP生成随机字符串
- php 随机生成字符串
- php生成随机字符串
- php生成随机字符串
- php生成随机字符串
- php生成随机字符串
- php 生成随机字符串
- php 生成随机字符串
- PHP随机生成字符串
- php 生成随机字符串
- PHP生成随机字符串
- PHP生成随机字符串
- php随机生成字符串
- php 生成随机字符串
- PHP生成随机字符串
- PHP生成随机字符串
- PHP生成随机字符串方法
- PHP生成八位随机字符串
- Html动态时钟实例
- 分布式,集群概念理解
- 【Python】Python3 List min()方法
- Digdata Development Java__Study_13(Java中线程Thread,线程池ExecutorService)
- CF Bear and Tree Jumps树形DP
- php 生成随机字符串
- Python网络爬虫与信息提取-Day5-Requests库网络爬取实战
- MAC安装mysql过程详解
- java 反射案例
- Intent的使用
- C指针
- Xamarin版的C# SVG路径解析器
- java 基础语法
- 和为S的两个数字