RE:[PHP] random number generator
| From: | Kraa de Simon | Date: | Fri, 20 Oct 2000 10:21:38 +0000 |
| Subject: | RE:[PHP] random number generator | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-21355@lists.php.net to get a copy of this message | ||
Try this one:
srand((double)microtime()*1000000); // seed the random number generator
$num = rand(1, 270);
Simon.
n e t b r a i n:
>Hi,
>
>I need an help in order to produce a unique number within a range of value
>from 1 to 270 ... I've tried
>$num=rand(1,270)
>but it doesn't seem to work ...
>
>many thanks in advance.
>max
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>For additional commands, e-mail: php-general-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
Met vriendelijke groet / With kind regards,
Simon de Kraa
ICL Logistic Systems
Simon.de.Kraa@icl.nl
---
Microsoft Windows 2000 Professional SP 1, Progress 9.1b, Roundtable 9.1a
SCO UnixWare 7.1.1, Progress 9.1a11