Pages
$path = ".";
//using the opendir function
$dir_handle = @opendir($path) or die("Unable to open $path");
//running the while loop
while ($file = readdir($dir_handle))
{
if(is_dir($file) && $file != "." && $file != "..")
{
$checkpath = $path."/".$file."/sitemap.xml";
if (file_exists($checkpath))
{
$sitename = ucwords(str_replace("-", " ", $file));
echo "
$sitename
\n\n";
}
}
}
//closing the directory
closedir($dir_handle);
?>