/**
* 生成指定位数的 随机数
* @param int $length 默认生成4位
* @return int
*/
function generate_code($length = 4) {
return rand(pow(10,($length-1)), pow(10,$length)-1);
}
/**
* 生成指定位数的 随机数
* @param int $length 默认生成4位
* @return int
*/
function generate_code($length = 4) {
return rand(pow(10,($length-1)), pow(10,$length)-1);
}