Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $dir_path = dirname(realpath(__FILE__)).'/f/';
- $extensions_array = array('jpg','png','jpeg');
- if(is_dir($dir_path)) {
- $files = scandir($dir_path);
- for($i = 0; $i < count($files); $i++) {
- if($files[$i] !='.' && $files[$i] !='..' && $files[$i] !='.php') {
- $file = pathinfo($files[$i]);
- $extension = $file['extension'];
- if(in_array($extension, $extensions_array)) {
- echo "<a href='f/$files[$i]' target='_blank'>
- <div style='background-image: url(/f/$files[$i]);' title='$files[$i]'></div></a>";
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment