View difference between Paste ID: rbH5psPr and DTkVHG2a
SHOW: | | - or go back to the newest paste.
1
$dir_path = dirname(realpath(__FILE__)).'/f/';
2
	$extensions_array = array('jpg','png','jpeg');
3
	if(is_dir($dir_path)) {
4
		$files = scandir($dir_path);
5
		for($i = 0; $i < count($files); $i++) {
6
			if($files[$i] !='.' && $files[$i] !='..' && $files[$i] !='.php') {
7
				$file = pathinfo($files[$i]);
8
				$extension = $file['extension'];
9
				if(in_array($extension, $extensions_array)) {
10
					echo "<a href='f/$files[$i]' target='_blank'>
11
					<div style='background-image: url(/f/$files[$i]);' title='$files[$i]'></div></a>";
12
				}
13
				
14
			}
15
		}
16
	}