/ Published in: PHP
count files in a given dir
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php function count_files($name) { $dirname = "galleries/$name"; if(!$dir_handle) return false; $files = 0; if($file != "." and $file != "..") { $files++; else $files += count_files($dirname . "/" . $file); } } return $files; } ?>