Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $imagetypes = array("image/jpeg");
- function getImages($folder) {
- $images = array();
- $directory = dir($folder);
- while(($entry = $directory->read()) !== false) {
- if($entry == '.' || $entry == '..' || !strstr($entry, '.')) {
- continue;
- }
- $images[] = $entry;
- }
- return $images;
- }
- $path = "tattoos";
- $docroot = "$path";
- $images = getImages($path);
- foreach($images as $image) {
- echo "<a href='{$path}/{$image}'>";
- $filename = explode('.', $image);
- echo "<img class='photo' src='{$path}/{$filename[0]}th.{$filename[1]}'>";
- echo "</a>\n"; }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement