Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $files = scandir('.', SCANDIR_SORT_NONE);
- if (!$files) {
- http_response_code(500);
- exit(1);
- }
- mime_content_type('application/json');
- function images($path) {
- return preg_match('/\.(jpg|png)$/', $path);
- }
- echo json_encode(array_values(array_filter($files, 'images')))
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement