srand

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() and getrandmax().