I'd randomize the whole array and pick the first 3 or 4 images in the order.
try shuffle().
If you have a multidimensional array, no problem:
$r = array(array('r' => 'me', 'n' => 'you'),array('r' => 'me2', 'n' => 'you2'),array('r' => 'me3', 'n' => 'you3'));
shuffle($r);
print_r($r);
You can then just select the first 2 or 3 images:
for($x=0;$x<2;$x++){
echo $r[$x]['r'] . " " . $r[$x]['n'];
}
//should return the first two ($x=0 and $x = 1).
diafol
Rhod Gilbert Fan (ardav)
7,796 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080