Re: Random number
| From: | Adam Charnock | Date: | Sun, 25 Jun 2000 13:42:14 +0000 |
| Subject: | Re: Random number | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-2980@lists.php.net to get a copy of this message | ||
Just use:
rand(min, max);
so..
rand(1, 10);
you could print it:
echo rand(1, 10);
Or put it in a variable:
$random = rand(1, 10);
Hope This Helps
Adam
At 19:21 25-06-00 +0700, you wrote:
hi all, simple question maybe, but I hit rocks here ... how to generate a random number, say from 1 to 10 ? thanks ERIS -- 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