Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Genrate Random Integer 10 digits 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 www.howtocodeschool.com #
 
PREVIOUS NEXT
Tagged: #Genrate #Random #Integer #digits #php
ADD COMMENT
Topic
Name
9+4 =