problems with mt_rand()
| From: | Benjamin deRuyter | Date: | Thu, 31 Jan 2002 20:02:25 +0000 |
| Subject: | problems with mt_rand() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-82979@lists.php.net to get a copy of this message | ||
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