note 39337 added to function.mt-rand

From: Date: Sun, 25 Jan 2004 14:08:52 +0000
Subject: note 39337 added to function.mt-rand
Groups: php.notes 
Request: Send a blank email to php-notes+get-64140@lists.php.net to get a copy of this message
When using PHP 4.3.4 and IIS 5.1 I had to use mt_srand() before mt_rand() in order to get a different random value on refresh. Otherwise the same value kept coming up. function get_random() { $randomnumber = mt_srand(); $randomnumber = mt_rand(1,92); print $randomnumber; } ---- Manual Page -- http://www.php.net/manual/en/function.mt-rand.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+39337 Delete -- http://master.php.net/manage/user-notes.php?action=delete+39337&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+39337&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#64140) next »