PHP mt_getrandmax() Function

In this chapter you will learn:

  1. Definition for PHP mt_getrandmax() Function
  2. Syntax for PHP mt_getrandmax() Function
  3. Parameter for PHP mt_getrandmax() Function
  4. Return for PHP mt_getrandmax() Function
  5. Example - Return largest possible random value that can be returned by mt_rand()

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.

Next chapter...

What you will learn in the next chapter:

  1. Definition for PHP mt_rand() Function
  2. Syntax for PHP mt_rand() Function
  3. Parameter for PHP mt_rand() Function
  4. Return for PHP mt_rand() Function
  5. Example - Generate random number in a range
  6. Example - generate random password