Hi,
I need to load images from 2 different folders, each thumbnail has its associated large version (same name, different folder).
I have 3 files in the large pics folder and 3 files in the thumbs folder and I'm getting 9 links! Each thumbnail gets repeated 3 times or x times the quantity of pics in the main folder
This is the code:
<?php
foreach (glob("images/*.jpg") as $large)
foreach (glob("images/thumbs/*.jpg") as $thumb)
{
echo ("<div class='thumbnail'><a href='$large'><img src='$thumb'/></a></div>");
}
?>
If I reverse the order of the foreach glob lines I get links x times the quantity of thumbnails. I hope I've made myself understood, I'm new to this.
Thanks!