//获取随机字符串 function get_randNum($len = 12) { $chars = '0123456789abcdefghijklmnopqrstuvwABCDEFGHIGKLMNOPQRSTUVWXYZ'; $str = ''; for ($i = 0; $i < $len; $i++) { $str .= $chars[mt_rand(0, strlen($chars) - 1)]; } return $str; }
Done!
//获取随机字符串 function get_randNum($len = 12) { $chars = '0123456789abcdefghijklmnopqrstuvwABCDEFGHIGKLMNOPQRSTUVWXYZ'; $str = ''; for ($i = 0; $i < $len; $i++) { $str .= $chars[mt_rand(0, strlen($chars) - 1)]; } return $str; }
Done!