i just used :
$i = 0;
$dirlist = array();
$thedir = ".";
$d = dir($thedir);
while($dirlist[$i]=$d->read()) {
if ($dirlist[$i] != "index.shtml" && $dirlist[$i] != "index.php"){ $i++; }
}
$d->close();
$dirsize=sizeof($dirlist);
to get an array of the directory contents, ignoring any index files.
-powlow