Random array element

From: Date: Tue, 07 Jan 2003 23:27:57 +0000
Subject: Random array element
Groups: php.general 
Request: Send a blank email to php-general+get-130649@lists.php.net to get a copy of this message
This is how I do in javascript: randNumber = new Array(); for (p = 0; p < 10; p++) { randNumber[p] = Math.floor(Math.random()*7); } weekday = new Array("monday","tuesday","wednesday","thursday","friday","saturday","sunday" ) randDay1 = weekday[randNumber[0]] randDay2 = weekday[randNumber[1]] .... I would like to achieve the same goal using php but I cannot get it to work.

« previous php.general (#130649) next »