<?php //path to the directory the images resides //$directory = "http://directory/of/your/image/"; //get all image files with a .jpg extension or you other extension, just replace jpg with gif,png or others $images = glob("" . $directory . "*.jpg"); //print each file name echo "<table><tr><td style=\"vertical-align: top;\">"; foreach($images as $image) { echo $image; echo "<br>"; echo "<img border=\"0\" src=\"http://directory/of/your/image/$image\" width=\"150\" height=\"100\">"; echo "<br>"; } echo "</td></tr></table>"; ?>
Image will be displayed in horizontal manner and I need to find a way so that the images can be displayed in a table layout but then that is for my next project.
No comments:
Post a Comment