Posted By

dsntos on 03/09/09


Tagged

php image directory


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

not_skeletor
vali29
BrianCoyDesign
benyates1


List all images from directory


 / Published in: PHP
 

  1. <?php
  2. $dir = "assets/images/";
  3. foreach (glob($dir . '/*') as $filename) {
  4. echo "<img src='" . $filename . "'><br/>";
  5. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: benyates1 on June 5, 2012

Is there anyway to get the images from say a thumbs directory linked to the larger versions from a images directory?

I've tried adding a change to the directory in the echo statement but it doesn't work as the thumbs part of the image location has already been set.

Any help would be greatly appreciated.

Thanks

You need to login to post a comment.