时间:2021-07-01 10:21:17 帮助过:50人阅读
- /*************
- *@l - length of random string
- */
- function generate_rand($l){
- $c= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
- srand((double)microtime()*1000000);
- for($i=0; $i<$l; $i++) {
- $rand.= $c[rand()%strlen($c)];
- }
- return $rand;
- }