mt_srand

(PHP 3>= 3.0.6, PHP 4 )

mt_srand -- Seed the better random number generator

Description

void mt_srand (int seed)

Seeds the random number generator with seed.


// seed with microseconds since last "whole" second
mt_srand ((double) microtime() * 1000000);
$randval = mt_rand();
      

See also mt_rand(), mt_getrandmax(), srand(), rand(), and getrandmax().