PHP Tutorial - PHP mt_getrandmax() Function






Definition

The mt_getrandmax() function returns the largest possible value that can be returned by mt_rand().

Syntax

PHP mt_getrandmax() Function has the following syntax.

mt_getrandmax();

Parameter

None

Return

Item Description
Return Value The largest possible value returned by mt_rand()
Return Type Integer

Example

Return largest possible random value that can be returned by mt_rand():


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

The code above generates the following result.