note 13844 added to function.array-rand.php

From: Date: Thu, 05 Jul 2001 21:28:27 +0000
Subject: note 13844 added to function.array-rand.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-15020@lists.php.net to get a copy of this message
If you dont need *serious* random numbers, for e.g. a simple banner rotation you may do something like this: <br> $rand_key = date("s") % sizeof($myarray); <br> this will rotate through the array every second. It is easier and faster than the random number generator. <br>You may also use REMOTE_PORT or the Process-Id to get a more randomized number http://www.php.net/manual/en/function.array-rand.php

« previous php.notes (#15020) next »