Stuff
public text v1 · immutablefunction sitemap_loop($array, $level) {
global $domain; global $xml;
foreach($array as $key => $item) {
if(is_array($item) && !isset($item['link'])) {
sitemap_loop($item, $level + 1);
}
else {
$xml .= "\t\t<url>\n";
$xml .= "\t\t\t<loc>$domain.$item[link]<\/loc>\n";
$xml .= "\t\t\t<lastmod>$item[lastmod]<\/lastmod>\n";
$xml .= "\t\t</url>\n";
}
}
}
$xml = '';
sitemap_loop($sitemap_array,0);