Last active
June 29, 2016 16:54
-
-
Save rodrigograca31/ff2c306d88981c7d2870893564d9f73d to your computer and use it in GitHub Desktop.
PHP File enumeration, ordered and no path
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 | |
header('Content-Type: application/json'); | |
$files = glob('./imgs/*.jpg'); | |
foreach($files as &$file) { | |
$file = str_replace("./imgs/", "", $file); | |
} | |
sort($files); | |
echo json_encode($files); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment