PHP Tutorial - PHP getrandmax() Function






Definition

The getrandmax() function returns the largest possible value that can be returned by rand().

Syntax

PHP getrandmax() Function has the following syntax.

getrandmax();

Parameter

None

Return

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

Example

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


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

The code above generates the following result.