Re: Random number generation...
| From: | elias | Date: | Wed, 02 May 2001 23:04:58 +0000 |
| Subject: | Re: Random number generation... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-51131@lists.php.net to get a copy of this message | ||
why not use the rand() ?
manual says:
rand -- Generate a random value
Description
int rand ([int min [, int max]])
If called without the optional min, max arguments rand() returns a
pseudo-random value between 0 and RAND_MAX. If you want a random number
between 5 and 15 (inclusive), for example, use rand (5, 15).
Remember to seed the random number generator before use with srand().
-elias
http://eassoft.cjb.net
<Tristan.Pretty@risk.sungard.com> wrote in message
news:85256A40.003E5D94.00@Notes_SMTP.risk.sungard.com...
>
>
> Hi there,
> A potentially dumb question here.
>
> Is there an easy way to display a random number between 1 and 20?
>
> I have looked on line, but either I am looking inall teh wrong places, or
there
> isn't this script on-line.
>
> Can anyone point me in the right direction?
>
> Cheers,
> Tris...
>
>
>
>
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
>
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
>
>
> **********************************************************************
>
> --
> 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
>