Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Random Integer in 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;
		}
Source by symfony.com #
 
PREVIOUS NEXT
Tagged: #Random #Integer #php
ADD COMMENT
Topic
Name
9+4 =