// 获取随机的字符串 function get_rand_char($length = 6) { $str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"; $strLength = 61; for($i = 0; $i < $length; $i ++) { $res .= $str [rand ( 0, $strLength )]; } return $res; }
Posted 每天增长一点点
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了获取随机的字符串相关的知识,希望对你有一定的参考价值。
// 获取随机的字符串 function get_rand_char($length = 6) { $str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"; $strLength = 61; for($i = 0; $i < $length; $i ++) { $res .= $str [rand ( 0, $strLength )]; } return $res; }
以上是关于获取随机的字符串的主要内容,如果未能解决你的问题,请参考以下文章