note 13588 added to function.rand.php

From: Date: Fri, 22 Jun 2001 18:41:14 +0000
Subject: note 13588 added to function.rand.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-14570@lists.php.net to get a copy of this message
I've only begun programming in PHP so there's probably a better way, but here's a Random Powerball picker example: <h2> Your Lucky PowerBall Number:<br> <? //seed the random generator srand((double)microtime()*1000000); //choose the 5 main numbers 1-49 for($p = 1; $p <= 5; $p++) { echo(rand(1,49)), " - "; } ?> <font color="red"> <? //choose the powerball number 1-45 displayed in red echo(rand(1,45)); ?> </font> </h2> http://www.php.net/manual/en/function.rand.php

« previous php.notes (#14570) next »