### Image Display Problem ###

From: Date: Tue, 26 Sep 2000 01:58:31 +0000
Subject: ### Image Display Problem ###
Groups: php.general 
Request: Send a blank email to php-general+get-17478@lists.php.net to get a copy of this message
Hello, I'm new to this list, so forigive a probably basic problem I present here: I'm trying to just iterate through a series of sub-directories of a main directory. In each subdirectory there are just a set of image files. All I would like to do is open each sub-directory, read the first image name from that directory, and display that image, then go to the next directory. For some reason I cannot get past a certain stage of just throwing out all image-names per directory. Here is what I'm working with so far: <? $path = '/home/sites/site10/web/members/gallery/thumbs_new'; $dir_handle = @opendir($path) or die("Unable to open $path"); while ($file = readdir($dir_handle)) { if ($file == "." or $file == "..") { // do nothing } else { $thumb_dir = '/home/sites/site10/web/ft_members/video/thumbs_new/' . $file; $directory = @opendir($thumb_dir) or die("Unable to open $thumb_dir"); while ($file = readdir($directory)) { if ($file == "." or $file == "..") { // do nothing } else{ echo "$file <BR>"; } } closedir($directory); echo "<P>"; } } closedir($dir_handle); ?> I think I need to create an array of the images as I iterate through each sub-directory so that I can just display one image per directory, but I'm at a loss as to where to nest this in and how? Any comments? ~ Theo

« previous php.general (#17478) next »