srand

(PHP 3, PHP 4 >= 4.0b1)

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