Okay, you are kind of on the right track. You randomize the number stored in "$picker"; however, you use that same number multiple times.
What you need to do is something like this:
elseif($option=='banner')
{
// How many images shoudl we show:
$show = 6;
for($i=0; $i<$show; $i++)
{
$picker = rand(0, $countlist);
echo("<a href='" . $mylist[$picker][0] . "'><img alt='" . $mylist[$picker][1] . "' src='" . $mylist[$picker][2] . "' border='0'/></a> ");
}
}
That will give you 6 random images; however, there will be duplicates since you only have 6 images. If you were to use only 2 or 3 loops, then you'd have a greater chance of not repeating images in the same set. What you can do is add a check to see if a specific image "id" has been used already, and if so, then to re-randomize the number. Something like this:
elseif($option=='banner')
{
// Store the already displayed $ids in this array:
$displayed = array();
// How many images shoudl we show:
$show = 6;
for($i=0; $i<$show; $i++)
{
$picker = rand(0, $countlist);
if(in_array($picker, $displayed))
{
$i--; // Put $i back to where it was before this loop
continue; // Restart the loop to get another random number ;)
}
echo("<a href='" . $mylist[$picker][0] . "'><img alt='" . $mylist[$picker][1] . "' src='" . $mylist[$picker][2] . "' border='0'/></a> ");
}
}
Something like that. Just remember, the more images you have to choose from, the less likely you are to have repeats.