Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (filter_input(INPUT_GET, 'var')) {
- $search_url = filter_input(INPUT_GET, 'var');
- } else {
- $search_url = filter_input(INPUT_POST, 'id');
- }
- if (strlen($search_url) < 1) {
- $search_url = 'photos/przedszkolaki';
- }
- $dirFiles = array();
- if ($handle = opendir($search_url)) {
- while (false !== ($file = readdir($handle))) {
- $crap = array(
- ".jpg",
- ".jpeg",
- ".JPG",
- ".JPEG",
- ".png",
- ".png",
- ".gif",
- ".GIF",
- ".bmp",
- ".BMP",
- "_",
- "-"
- );
- $newstring = str_replace($crap, " ", $file);
- if ($file != "." && $file != ".." && $file != "Thumbs.db") {
- $dirFiles[] = $file;
- }
- }
- closedir($handle);
- }
- sort($dirFiles);
- foreach ($dirFiles as $file) {
- echo '<figure>';
- echo '<img src=" ' . $search_url . '/' . $file . '" class="img-rounded " >';
- echo '</figure>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement