$files = 0;
$folders = 0;
$images = 0;
$php = 0;
$html = 0;
$css = 0;
$js = 0;
$dir = glob("../");
foreach ($dir as $obj) {
if (is_dir($obj)) {
$folders++;
$scan = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($obj, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST);
foreach ($scan as $file) {
if (is_file($file)) {
$files++;
$exp = explode(".", $file);
if (@array_search("png", $exp) || @array_search("jpg", $exp) || @array_search("svg", $exp) || @array_search("jpeg", $exp) || @array_search("gif", $exp)) {
$images++;
} else if (@array_search("php", $exp)) {
$php++;
} else if (@array_search("html", $exp) || @array_search("htm", $exp)) {
$html++;
} else if (@array_search("css", $exp)) {
$css++;
} else if (@array_search("js", $exp)) {
$js++;
}
} else {
$folders++;
}
}
} else {
$files++;
}
}
echo $files . ' Files
';
echo $folders . ' Folders
';
echo $images . ' Images
';
echo $php . ' PHP Files
';
echo $html . ' HTML Files
';
echo $css . ' CSS Files
';
echo $js . ' JSS Files
';