September 2001
Intermediate to advanced
768 pages
32h 45m
English
void mt_srand(int seed) Seeds the random number generator for mt_rand() .
Returns:
Nothing
Description:
This function seeds the random number generator for mt_rand(). The greater the randomness of the initial seed passed to this function, the better the randomness of the numbers later generated by mt_rand().
This function needs to be called only once per script, before any calls to mt_rand().
Version:
PHP 3 since 3.0.6, PHP 4
See also:
getrandmax() mt_getrandmax() mt_rand() rand() srand()
Example:
mt_srand((double) microtime() * 1000000); |
Read now
Unlock full access