Created
August 12, 2015 05:59
-
-
Save keegandonley/1f63888cd02de3faf32c to your computer and use it in GitHub Desktop.
Return list of files in a directory
This file contains 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 | |
$images = array(); | |
$dir = opendir('../img/easyPhotoGallery/'); | |
while (($file = readdir($dir)) !== false) | |
{ | |
if (substr($file,0,1) !== ".") { //Ignore system files | |
$images[] = $file; | |
} | |
} | |
closedir($dir); | |
echo json_encode($images); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment