Angka acak genrate dalam PHP

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;
		}
Nilesh