So I need to call it each time the page gets reloaded I guess....

I can't just have the user load a file called generate.php which has the
mt_srand....and then keep calling random.php (which has mt_rand) without
calling generate.php   right?

-----Original Message-----
From: Jon Haworth [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, October 16, 2002 3:40 PM
To: 'Phil Schwarzmann'; [EMAIL PROTECTED]
Subject: RE: [PHP] seeding using mt_srand();

Hi Phil,

> How often do you need to call mt_srand(); ?  

As of version 4.2.0 you don't have to call it at all. If your PHP
installation is an earlier version than that, call it once per script,
before generating any random numbers, e.g:

$randomA = mt_rand();
$randomB = mt_rand();
$randomC = mt_rand();

> Just once?  Or each time the page gets reloaded?

Uh... same thing, surely?


PHP General Mailing List (
To unsubscribe, visit:

Reply via email to