PHP » GoLang |
login |
register |
about
|
mt_rand(PHP 4, PHP 5, PHP 7) mt_rand — Generate a random value via the Mersenne Twister Random Number Generator Description
int mt_rand
( void
)
int mt_rand
( int
$min
, int $max
)Caution
This function does not generate cryptographically secure values, and should not be used for cryptographic purposes. If you need a cryptographically secure value, consider using random_int(), random_bytes(), or openssl_random_pseudo_bytes() instead. Many random number generators of older libcs have dubious or unknown characteristics and are slow. The mt_rand() function is a drop-in replacement for the older rand(). It uses a random number generator with known characteristics using the » Mersenne Twister, which will produce random numbers four times faster than what the average libc rand() provides.
If called without the optional Parameters
Return Values
A random integer value between Changelog
Examples
Example #1 mt_rand() example
<?php The above example will output something similar to: 1604716014 1478613278 6 NotesWarning
See Also
|
more
Recently updated
more
Most requested
more
Last requests
|