Posted By

onefastsnail on 05/24/12


Tagged


Versions (?)

list images in dir


 / Published in: Other
 

  1. <?
  2.  
  3. //path to directory to scan
  4. $directory = "";
  5.  
  6. //get all image files with a .jpg extension.
  7. $images = glob($directory . "*.jpg");
  8.  
  9. //print each file name
  10. foreach($images as $image)
  11. {
  12.  
  13. ?>
  14. <img src="<?=$image;?>" alt="" />
  15. <? }
  16.  
  17. ?>

Report this snippet  

You need to login to post a comment.