PHP code example of modulebz / sitemap_xml

1. Go to this page and download the library: Download modulebz/sitemap_xml library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

modulebz / sitemap_xml example snippets




use ModuleBZ\Sitemap;
use ModuleBZ\Sitemap\EChangeFreq;
s.org/',time(),0.1,EChangeFreq::MONTHLY)
    ->addLink('https://www.sitemaps.org/protocol.html',date('Y-m-d',time()),0.1,EChangeFreq::MONTHLY)
    ->addLink('https://www.sitemaps.org/protocol.html')
;

// Выводим сразу xml файл с необходимыми заголовками
$sitemap->echoXml();
// Или сначала смотрим получившийся код в формате строки
// echo htmlspecialchars($sitemap);