<?php
// save as make-sitemap-cities.php and hit it once in the browser.
// It will write /sitemap-cities.xml next to this script.
$allowed = require __DIR__ . '/city-allowed.php'; // or paste the array here
$base = 'https://www.fullcoloryardsigns.com';
$now  = gmdate('Y-m-d\TH:i:s\Z');

$xml  = new DOMDocument('1.0', 'UTF-8');
$urlset = $xml->createElement('urlset');
$urlset->setAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');
$xml->appendChild($urlset);

foreach ($allowed as $slug => $name) {
  $url = $xml->createElement('url');
  $url->appendChild($xml->createElement('loc', rtrim($base, '/')."/cities/{$slug}/"));
  $url->appendChild($xml->createElement('lastmod', $now));
  $url->appendChild($xml->createElement('changefreq', 'weekly'));
  $url->appendChild($xml->createElement('priority', '0.6'));
  $urlset->appendChild($url);
}

$xml->formatOutput = true;
file_put_contents(__DIR__ . '/sitemap-cities.xml', $xml->saveXML());
echo "Wrote sitemap-cities.xml\n";
