Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function countLines($path) {
- $num = 0;
- foreach(scandir($path) as $file) {
- if(substr($file, -3, 3) == '.cs') {
- $num += count(file($path . DIRECTORY_SEPARATOR . $file));
- } else if(is_dir($path . DIRECTORY_SEPARATOR . $file) && substr($file, -1) != '.') {
- $num += countLines($path . DIRECTORY_SEPARATOR . $file);
- }
- }
- return $num;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment