Hi there all:
I have a for-loop that displays images from my DB. I echo the result of the loop directly to the page thus:
for ($count = 0; $count < count($image); $count++) {
echo <a href=\"sport.php?id=$sportID\">$image</a>";
}
//end for-loop
I'd rather not do it this way for neatness of code so I do this instead:
for ($count = 0; $count < count($image); $count++) {
$display_this = $display_this . <a href=\"sport.php?id=$sportID\">$image</a>";
}
//end for-loop
This now displays all my images in a line horizontally across the page, exceeding the page width if there are more than 4 images.
I'm looking for a way to display these so that they drop down a line after 4 or so.
I can do it if I leave a space after $image in the loop, but then a hyphen of sorts '-' is displayed after each image.
Can anyone help me eliminate this hyphen AND have my images automatically drop down a line when they reach the pages right margin? (As text would normally do)
Many thanks:
Russ