The PHP rand() function generates a random integer.

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

Syntax

				
					rand()
// or
rand(min,max)
				
			

Parameters

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