Re: Array_rand issue...

From: Date: Sun, 02 Jun 2002 00:45:57 +0000
Subject: Re: Array_rand issue...
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-19569@lists.php.net to get a copy of this message
Here is how you do it: $pictures = array( 1, 2, 3, 4, 5, 6, 7, etc.) shuffle($pictures) //This will randomly rearrange them in the array. //then echo "$pictures[1] echo $pictures[2] echo $pictures[3]"; Dave Carrera <dave@davecarrera.com> wrote: Hi All I have a fuctioning array of about 20 items. What i would like to do is display 3 items from the array randomly and be able to place the output anywhere on the screen. I have looked at array_rand and associated functions at php.net and are currently playing with the code to see if i can make it work but some guidence in this matter would be very much appreciated. Thank you in advance Dave C -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --------------------------------- Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup

« previous php.db (#19569) next »