Seeds the random number generator.
srand() seeds the random number generator. Since PHP 4.2.0 this is unnecessary, since PHP does the seeding automatically. The seed parameter is also optional.
<?php
$seed = explode(" ", microtime());
$seed = $seed[0] * 1000000;
print "seed: $seed";
srand($seed);
?> seed: 20071 The microseconds component of the value return from microtime() is used to create a seed that changes often.