I'm using php to get & display the images in a folder and everything has been working fine until I added the NEW images to the folder - It's now adding a blank space before the first gallery image. When I echo out the $count
it shows that there are 8 files instead of the 7 that there actually are. What is the reason for this and how can I prevent it?
My PHP code is:
<div id="gallery">
<h1>Take A Look Around:</h1>
<p>
<?php
$folder = 'gallery/';
$filetype = '*.*';
$files = glob($folder.$filetype);
$count = count($files);
for ($i = ($count-1); $i >= 0; $i--) {
echo '<div class="photoHolder"><div class="photoCell"><a class="fancybox" rel="group" href="'.$files[$i].'"><img class="photo" src="'.$files[$i].'" alt=""></a></div></div>';
}
?>
<div class="clearLeft"></div><?php echo $count; ?>
</p>
</div>