I know this is simple, but how would I set a variable to a random number between 0 and count($array) ? Thanks, -Matt ------------------ ----- ComicalPics.com
You could use the mt_rand() PHP function: int mt_rand( [int min] , [int max] ); For example: <BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>// create a random number between 0 and 10 $array = array (1,2,3,4,5,6,7,8,9,10); $random_number = mt_rand (0, count($array));[/code] ------------------ Antti Huotari.com/antti/ LinuxWebDevNews.com
Forum Rules
Bookmarks