How would you count the number of files in a directory?
$dir = "/blah"; $count = 0; if(is_dir($dir)) { if($handle = opendir($dir)) { while(($file = readdir($handle)) !== false) { $count++; } closedir($handle); } }