note 27339 deleted from function.rand by philip

From: Date: Sun, 08 Dec 2002 20:15:34 +0000
Subject: note 27339 deleted from function.rand by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-40543@lists.php.net to get a copy of this message
A way to quicky and randomly select a value from an array can be done a follows. <?php #Create the array $array = array('Dave','Mary','Arnold','Doug'); #Create a random number $num = rand(0,3); #Output print ("<title>".$array[$num]."</title>"); ?>

« previous php.notes (#40543) next »