Created
November 7, 2016 02:36
-
-
Save darkcolonist/e7604f74302df19ba7944ef3e0f519de to your computer and use it in GitHub Desktop.
display all images inside a folder in a tabular format (php)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* original source: http://stackoverflow.com/a/11903460/27698 | |
*/ | |
// $dirname = "media/images/iconized/"; | |
$dirname = "./"; | |
$images = glob("*.{jpg,png,gif}", GLOB_BRACE); | |
echo "<table>"; | |
echo "<tr><th>source</th><th>image preview</th></tr>"; | |
foreach($images as $image) { | |
echo '<tr>'; | |
echo '<td>'.$image.'</td>'; | |
echo '<td><img src="'.$image.'" /></td>'; | |
echo '</tr>'; | |
} | |
echo "</table>"; |
Author
darkcolonist
commented
Nov 7, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment