$value) { if (is_dir($dir . DIRECTORY_SEPARATOR . $value)) { $result[$value] = dirToArray($dir . DIRECTORY_SEPARATOR . $value); } else { if (substr($value, -3) == '.js') { if (!in_array($value, $fileIgnore)) { $result[] = substr($value, 0, -3); } } } } return $result; } function displaySection($title, $files) { echo "

$title

"; echo ""; } $path = realpath('../src'); $files = dirToArray($path); displaySection("Phaser v2.1.1", $files); // echo "
";
    // print_r($files);
    // echo "
"; ?>