I made this piece of code, and it echo's out 5 random rows of data from the array every time you run it.
What I really want it to be is that it takes 5 random values of the array and echo out the same values for 5 minutes before it randomizes again.
I know it's possible with MySQL by just storing the information there, but I would prefer a maybe easier / simpler way. If it would be possible with PHP only, that'd be great.
$random = $id; // make a copy of the multi-dimensional array
for($i = 0; $i < 5; $i++) {
shuffle($random); // randomize order
$results = array_pop($random); // return last value and remove from array
echo $result[0][0], " ", $result[0][1], "<br>\n";
}
Anybody who has an idea or suggestions?