Re: Random number generation...
| From: | Avetis Avagyan | Date: | Wed, 02 May 2001 13:02:37 +0000 |
| Subject: | Re: Random number generation... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-51133@lists.php.net to get a copy of this message | ||
<?php
srand((double)microtime()*1000000);
$number = rand(1,20);
echo $number;
?>
Regards,
Avetis
Tristan.Pretty@risk.sungard.com wrote:
> 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
--
avetis@undp.am
ICT Specialist
UNDP, Armenia