Hi All,
I am listing all the 'categories' with in a directory which is working now i want to try and find out the number of "folders" with in each of the category directories
here is my code
PHP Code:
<?php
#get portfolio categories
if ($handle = opendir('portfolio'))
{
#echo "Directory handle: $handle\n";
#echo "Entries:\n";
$x = 1;
/* This is the correct way to loop over the directory. */
while (false !== ($entry = readdir($handle)))
{
#echo $entry;
if ($entry != "." && $entry != "..")
{
###count folders inside directorys
$directory = "portfolio/".$entry;
###end count folders inside directories
if (($x % 3) == 0)
{
$className = "col-2";
}
else
{
$className = "col-1";
}
?>
<div class="<?php echo $className?>">
<figure class="img-box">
<a href="portfolio-weddings.html">
<img src="images/page3-img1.jpg" alt="">
</a>
</figure>
<div class="gallery-meta">
<a href="#" class="gallery-name"><?php echo ucwords($entry);?></a>
<span class="capacity">(<?php echo $count; ?> Albums)</span>
</div>
</div><?php
$x++;
}
}
closedir($handle);
}?>
i've got up to the point of setting the individual categories now i need to figure out how to count the number of folders within these directories
can anyone help me please
thanks
Luke