read()) { if($file != "." && $file != ".." && $file != ".svn") { $images = array(); $sub_dir = dir("images/albums/".$file); while($image = $sub_dir->read()) { if($image != "." && $image != ".." && $image != ".svn" && !preg_match('/_tn_/', $image)) array_push($images, $image); } $sub_dir->close(); array_push($albums, array('id' => $i++, 'name' => $file, 'path' => "images/albums/".$file, 'images' => $images, 'length' => count($images))); } } $album_dir->close(); echo ''; ?>