Revision: 16402
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at August 3, 2009 09:55 by fackz
Initial Code
<?php function count_files($name) { $dirname = "galleries/$name"; if(is_dir($dirname)) $dir_handle = opendir($dirname); if(!$dir_handle) return false; $files = 0; while($file = readdir($dir_handle)) { if($file != "." and $file != "..") { if(!is_dir($dirname . "/" . $file)) $files++; else $files += count_files($dirname . "/" . $file); } } closedir($dir_handle); return $files; } ?>
Initial URL
Initial Description
count files in a given dir
Initial Title
count files in a given dir
Initial Tags
files
Initial Language
PHP