eof; if (!empty($dir['snapshot'])) { echo << eof; }else if (!empty($dir['files'])) { $first_img = array_shift($dir['files']); echo << eof; } echo <<{$dir['directory']} eof; } }else if (!empty($category['files'])) { foreach($category['files'] as $file) { if (!in_array($file['extension'], $imgExts)) {continue;} echo << eof; } } ?>