Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2014
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.30 KB | None | 0 0
  1. <?php
  2.     $path = $_SERVER['DOCUMENT_ROOT'] . '/images/';
  3.     $images = scandir($path);
  4.     if (false !== $images) {
  5.             $images = preg_grep('/\\.(?:png|gif|jpe?g)$/', $images);
  6.             foreach ($images as $image) {
  7.                 echo '<img src="/images/', htmlspecialchars(urlencode($image)),'"/>';
  8.             }
  9.     }
  10. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement