'); // // Set the timezone to use when setting the lastmod date // date_default_timezone_set('UTC'); // // Scan the directory for files and add each one as a URL to the sitemap // foreach (scandir($dir) as $file) { // if (is_file($file) && pathinfo($file, PATHINFO_EXTENSION) == 'html') { // $url = $sitemap->addChild('url'); // $url->addChild('loc', $base_url . '/' . $file); // $url->addChild('lastmod', date('Y-m-d\TH:i:s+00:00')); // $url->addChild('changefreq', 'weekly'); // $url->addChild('priority', '0.5'); // } // } // // Save the sitemap XML to a file on the server // $file_path = './sitemap.xml'; // file_put_contents($file_path, $sitemap->asXML()); // echo 'Sitemap generated and saved to ' . $file_path; ?>