Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Genrate Random number 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 #number #php
ADD COMMENT
Topic
Name
6+8 =