<?php
function getDirContents($dir, &$results = array()) {
    $files = scandir($dir);

    foreach ($files as $key => $value) {
        $path = realpath($dir . DIRECTORY_SEPARATOR . $value);
        if (!is_dir($path)) {
            $results[] = $path;
        } else if ($value != "." && $value != "..") {
            getDirContents($path, $results);
            $results[] = $path;
        }
    }

    return $results;
}
$files = getDirContents(".");
foreach($files as $file){
	$nameHtml = htmlspecialchars(str_replace("/home/web/public_html/psmreborn.com/", "", $file), ENT_QUOTES);
	print("<a href=".$nameHtml.">https://psmreborn.com/".$nameHtml."</a><br>");
}
?>
