function rand_str($randLength = 16) { //$randLength = 随机字符串的长度 $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUNWXYZ'; //自定义随机出现的字符 $len = strlen($chars); $randStr = ''; for ($i = 0; $i < $randLength; $i++) { $randStr .= $chars[mt_rand(0, $len - 1)…