Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $path = $_SERVER['DOCUMENT_ROOT'] . '/images/';
- $images = scandir($path);
- if (false !== $images) {
- $images = preg_grep('/\\.(?:png|gif|jpe?g)$/', $images);
- foreach ($images as $image) {
- echo '<img src="/images/', htmlspecialchars(urlencode($image)),'"/>';
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement