Re: Randomiser

From: Date: Fri, 17 Oct 2008 12:20:37 +0000
Subject: Re: Randomiser
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-282029@lists.php.net to get a copy of this message
I ended up using an example from the PHP website. <?php $input = array("Neo", "Morpheus", "Trinity", "Cypher", "Tank"); $rand_keys = array_rand($input, 2); echo $input[$rand_keys[0]] . "\n"; echo $input[$rand_keys[1]] . "\n"; ?> Just extended the array to the number of lines I needed. Andrew

« previous php.general (#282029) next »