📅  最后修改于: 2022-03-11 14:54:44.894000             🧑  作者: Mango
function genrateRandomInteger($len = 10)
{
$last =-1; $code = '';
for ($i=0;$i<$len;$i++)
{
do {
$next_digit=mt_rand(0,9);
}
while ($next_digit == $last);
$last=$next_digit;
$code.=$next_digit;
}
return $code;
}