I'd like to display a number of images and change the order on each load.
Let's say I have 10 images and I can only show 5 at a time. Each needs to be linked to a unique URL. I was thinking of putting them into an array
$imgs = array(
1 => "imgA.gif",
2 => "imgB.gif",
3 => "imgC.gif",
4 => "imgD.gif",
5 => "imgE.gif",
...);
shuffle($imgs);
foreach ($imgs as $key => $value) {
<a href="/myURL?id=$key"><img src="$value"></a>
}
How do I mix and match the image order and show only 5? I think shuffle should do to change order, how do I limit it? Ahhh... afternoon slow-down in brain activity...