RE: [PHP-ES] Aleatorios
| From: | Francisco Mendoza | Date: | Tue, 10 Sep 2002 21:49:06 +0000 |
| Subject: | RE: [PHP-ES] Aleatorios | ||
| References: | 1 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-26730@lists.php.net to get a copy of this message | ||
Del manual:
srand
(PHP 3, PHP 4 )
srand -- Seed the random number generator
Description
void srand ( int seed)
Seeds the random number generator with seed.
// seed with microseconds
function make_seed() {
list($usec, $sec) = explode(' ', microtime());
return (float) $sec + ((float) $usec * 100000);
}
srand(make_seed());
$randval = rand();