Rishi
public text v1 · immutable
<?
$lines = 0;
function print_dir($dir = "", $indent = 0){
global $lines;
foreach (glob("$dir*") as $file){
if (is_dir($file)){ $dir = true; }else{ $dir = false; }
if (substr_count($file, ".php") >= 1 || $dir){
for ($i = 0; $i < $indent; $i++){
echo " ";
}
echo $file;
echo "\n";
if ($dir){
if ($file != "include2"){
print_dir($file."/", $indent+1);
}
}else{
$lines += count(file($file));
}
}
}
}
print_dir();
echo "\n";
echo "Lines: $lines";
?>