The PHP mt_rand() function generates a random integer using the Mersenne Twister algorithm.

				
					<?php
echo(mt_rand());
?>
				
			

Syntax

				
					mt_rand()
// or
mt_rand(min,max)
				
			

Parameters

ParameterDescription
minSpecifies the lowest number to return (default is 0)
maxSpecifies the highest number to return (default is mt_getrandmax())