Re: Random Function

From: Date: Sun, 16 Nov 2003 14:14:28 +0000
Subject: Re: Random Function
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-169822@lists.php.net to get a copy of this message
On Saturday 15 November 2003 02:38, Teren wrote: > Sorry, i copied a little extra stuff from console. This is what it is, > Anyways, it works fine if I put 0 in for 1 on line 9 where it uses the > rand(), but it include 0 and I can't have 0. Is there some way to fix that? > If you need to see the demo of it working with the 0 in place, i can do > that. I haven't examined your code in detail but: 1) mt_rand() is supposed to generate 'better' (more random) random numbers 2) As a quick fix couldn't you just use the lower limit of 0, but add 1 onto each number generated? -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* Everything you like is bad for you -- Murphy's Food Laws n1 */

« previous php.general (#169822) next »