Hi Yall
I have a page where I want 5 images to appear, randomly selected from a pool
of 50 images called 1.jpg to 50.jpg
The following code works nicely, except for one (probably obvious)
problem...
$count=1;
do {
$random = rand(1,50);
echo "<img src='images/$random.jpg'>";
$count++;
}
while ($count<5);
The problem is that there is nothing to stop images appearing more than
once. I do not want this to happen...
Any ideas on a possible solution?
TIA
Mark
I have a page where I want 5 images to appear, randomly selected from a pool
of 50 images called 1.jpg to 50.jpg
The following code works nicely, except for one (probably obvious)
problem...
$count=1;
do {
$random = rand(1,50);
echo "<img src='images/$random.jpg'>";
$count++;
}
while ($count<5);
The problem is that there is nothing to stop images appearing more than
once. I do not want this to happen...
Any ideas on a possible solution?
TIA
Mark
Comment