PHP mt_getrandmax() Function
In this chapter you will learn:
- Definition for PHP mt_getrandmax() Function
- Syntax for PHP mt_getrandmax() Function
- Parameter for PHP mt_getrandmax() Function
- Return for PHP mt_getrandmax() Function
- 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:
- Definition for PHP mt_rand() Function
- Syntax for PHP mt_rand() Function
- Parameter for PHP mt_rand() Function
- Return for PHP mt_rand() Function
- Example - Generate random number in a range
- Example - generate random password
Home » PHP Tutorial » PHP Math Functions