quote:
Originally posted by Segosa
code:
function count_files($dir){
$dh = opendir($dir);
$files = array();
while (false !== ($filename = readdir($dh))) {
$files[] = $filename;
}
sort($files);
array_splice($files, 0, 2);
$filesnum = count($files);
return $filesnum;
}
Couldn't you just make that...
code:
function count_files($dir)
{
$dh=opendir($dir);
for($i=0;readdir($dh);$i++);
return $i-2;
}
Yeh, i just coppied it from another script that needs to acces the files afterwards, with out thinking about editing it down.