Last active
August 29, 2015 14:00
-
-
Save mattbullen/11128025 to your computer and use it in GitHub Desktop.
A quick work-around to push a folder of image files from the server into an HTML list on a page.
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
<div id="image-wrapper"> | |
<li id="image-list"> | |
<?php | |
$counter = 0; | |
$directory = "images/"; | |
$images = glob($directory . "*.png"); | |
foreach($images as $image) { //Open bracket | |
?> | |
<a href="<? echo $image; ?>" id="image-href-"<? echo $counter; ?>"> | |
<img src="<? echo $image; ?>" id="image-number-"<? echo $counter; ?>"/> | |
</a> | |
<? | |
$counter++; | |
} //Close bracket | |
?> | |
</li> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment