Creating an XML sitemap with PHP

<?php
header("Content-Type: application/xml; charset=utf-8");
$mywebaddress = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]";
$sitemap = '';

$sitemap .= '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
          http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">';

          $pages = array(
              "index.php"
                );

                //Read each feed's items
                $entries = array();
                foreach($pages as $cat)...
WebBeer - Beer & Code | Product Hunt Embed