srand

(PHP3 , PHP4 )

srand -- Seed the random number generator

Description

void srand (int seed)

Seeds the random number generator with seed.


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

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