In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > I need to generate a random number (range is not crucial) and I have been > trying to use mt_rand(). However, I am finding that is generates the same > value EVERY time. This is true whether I supple a range or not. For > example, the follow line of code generated 13 EVERY time... > > $result = mt_rand(1,15); > echo $result; > > In addition, this line of code generated 1755202938 EVERY time... > > $result = mt_rand(); > echo $result; > > What am I doing wrong?? > > - Ben
One usually needs to seed a random generator; looking at the docs I find mt_srand which is the tool you need. -- David Robley Temporary Kiwi! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]