I like to use glob() and then just do a foreach() on the resulting array.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
How can i display the following on the same page as the image. On my page image is displayed on the left and i want to include the folder content on the right.
Ignore jQuery or any JavaScript solution.
@NogDog is right.
simple
Code:
if($count = count($files = glob(getcwd('*.jpg')) > 0):
foreach($files as $file):
if(file_exists($file)):
// if you want to show a thumb nail, learn the GD lib.
?>
<img src="<?php echo $file; ?>">
<?php endif;
endforeach;
endif;
?>
Bookmarks