随机生成32位字符串_在线工具
php随机数,随机字符串,随机生成工具,php随机生成32位字符串
php随机生成字符串函数,可自定义位数
PHP代码 |
<?php function randrom($length = 32, $te = 0) { $str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; if ($te) { $str .= '!@#$%^&*'; } $len = strlen($str)-1; $randstr = ''; for($i = 0; $i < $length; $i++){ $num = mt_rand(0,$len); $randstr .= $str[$num]; } return $randstr; } echo randrom(); // Dbz9vckfaMCa2odvphqgEv3UYVStq4WJ ?> |
如有疑问,请联系站长QQ:1076672113