<?php
// Initializing variables
$totalFolders = 0;
$totalFiles = 0;
$totalPHPFiles = 0;

// Get all elements from the folder
$currentFiles = scandir(".");

// Looping through all the files
foreach($currentFiles as $file) {
  // Make sure its not the directory '.' or '..'
  if($file != "." && $file != "..") {
	// Check if the file is a folder
	if(is_dir($file)) {
	  $totalFolders++;
	} else {
	  $totalFiles++;
	  // Check if it is a PHP file
	  if(pathinfo($file, PATHINFO_EXTENSION) == "php") {
		$totalPHPFiles++;
		echo '<a href="' . $file . '">' . $file . '</a><br />';
	  }
	}
  }
}

// Print the results
echo "Total Folders: " . $totalFolders . "<br />";
echo "Total Files: " . $totalFiles . "<br />";
echo "Total PHP Files: " . $totalPHPFiles;
?>