mt_getrandmax() returns the largest value that mt_rand() can generate. It is mainly useful when working directly with the Mersenne Twister generator.
echo mt_getrandmax();
<?Php
echo mt_getrandmax(); // Maximum value available to mt_rand()
?>
Syntax
int mt_getrandmax()
Returns the largest value that mt_rand() can return when no range is supplied.
For newly written code, PHP recommends the object-oriented Random\Randomizer API. Use random_int() when unpredictability is required.
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.