mt_getrandmax(): largest possible random value

Check the maximum mt_rand() value

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.


Math Functions random_int(): secure random integers


Subscribe to our YouTube Channel here



plus2net.com











PHP video Tutorials
✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer