I'm displaying photos from the thumbnails folder and having a link to the photo in different folder.
The problem is that it's displaying all the photos but making a mess with the links.
Example:
It's showing photo # 1 and link it to photo # 3.
How can I solve that?
Any help will be welcomed.
Thanks,
Amir
<?php
$files = array_merge(glob("photos/nature/*.jpg"), glob("photos/nature/*.JPG"), glob("photos/nature/*.JPEG"), glob("photos/nature/*.jpeg")); for ($i=0; $i<count($files); $i++) {
$files_1 = array_merge(glob("photos/thumbnails/nature/*.jpg"), glob("photos/thumbnails/nature/*.JPG"), glob("photos/thumbnails/nature/*.JPEG"), glob("photos/thumbnails/nature/*.jpeg")); for ($i=0; $i<count($files); $i++) {
$num = $files[$i];
$num_1 = $files_1[$i];
echo '<li><a href="'.$num.'"><img src="'.$num_1.'" alt=" " width="120" height="120" /></a></li>';
}}?>


Sign In
Create Account


Back to top









