Jump to content

scandir with two arrays


ultraloveninja

Recommended Posts

I am using scandir to scan two folders and then output the HTML.  I can get it to work for one directory (the thumbnails)  but I'm not sure how to get the other directory to output the array.

 

 

Here's my code:

 

<?php

$dir2 = 'basement-pics';
$scan2 = scandir($dir2);


$dir = 'basement-pics/thumbs/';
$scan = scandir($dir);

for ($i = 0; $i<count($scan); $i++) {

if ($scan[$i] != '.' && $scan[$i] != '..') {
echo '<a href="' . $scan2 . '"><img src="basement-pics/thumbs/' . $scan[$i]. '" /></a>';
}
};
?>

 

 

This is new ground for me so any help is greatly appreciated.  Thanks!

Link to comment
https://forums.phpfreaks.com/topic/265170-scandir-with-two-arrays/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.