note 71232 rejected from function.srand by nlopess

From: Date: Fri, 17 Nov 2006 17:09:44 +0000
Subject: note 71232 rejected from function.srand by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-119842@lists.php.net to get a copy of this message
Note Submitter: webmaster at frontslc dot com ---- Will different seeds ever produce the same random number? I need to generate a sequence of distinct, but random, codes. As an example: for ($i=0; $i<=300000; $i++) { srand($i); $random_number = random(0, 300000); }; Will I ever get the same random_number twice?

« previous php.notes (#119842) next »