Last active
August 29, 2015 14:06
-
-
Save aurbano/79df9df8d6c5e539f525 to your computer and use it in GitHub Desktop.
Display all files in folder
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 | |
include('displayFiles.php'); | |
displayFiles('pictures'); |
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 | |
function displayFiles($folder){ | |
$handle = opendir(dirname(realpath(__FILE__)).$folder); | |
while($file = readdir($handle)){ | |
if($file !== '.' && $file !== '..'){ | |
echo 'pictures/'.$file; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment