#Directory Listing: Images , php # <?PHP // fetch image details $images = getImages("images"); // display on page foreach($images as $img) { echo "<div class=\"photo\">"; echo "<img src=\"{$img['file']}\" {$img['size'][3]} alt=\"\"><br>\n"; // display image file name as link echo "<a href=\"{$img['file']}\">",basename($img['file']),"</a><br>\n"; // display image dimenstions echo "({$img['size'][0]} x {$img['size'][1]} pixels)<br>\n"; // display mime_type echo $img['size']['mime']; echo "</div>\n"; } ?> /* css */ <style type="text/css"> .photo { float: left; margin: 0.5em; border: 1px solid #ccc; padding: 1em; font-size: 10px; } </style>