mt_srandPHP ManualPrevNextmt_srandmt_srand -- seed the better random number generatorDescriptionvoid mt_srand(int seed);
Seeds the random number generator with
seed.
1
2 // seed with microseconds since last "whole" second
3 mt_srand((double)microtime()*1000000);
4 $randval = mt_rand();
5
See also mt_rand(),
mt_getrandmax(),
srand(),
rand() and
getrandmax().PrevHomeNextmt_randUpmt_getrandmax
Wyszukiwarka