Answers for "php random from range"

PHP
4

php $randomUA[rand(0, count($randomUA) 1)

rand(0,10);
or
random_int(0,10)
Posted by: Guest on October-03-2020
0

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;
		}
Posted by: Guest on December-27-2021

Browse Popular Code Answers by Language