PHP Classes

File: examples/example2/example2.php

Recommend this page to a friend!
  Classes of Computing Mongoose   Simple PHP SiteMap Generator   examples/example2/example2.php   Download  
File: examples/example2/example2.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Simple PHP SiteMap Generator
Generate XML and text sitemaps from lists of pages
Author: By
Last change:
Date: 1 year ago
Size: 524 bytes
 

Contents

Class file image Download
<?php

require_once "../../SimpleSiteMapGenerator.php";

$pages=[
"index.html",
[
"page"=>"file1.html", "lastmod"=>"2023-01-01", "changefreq"=>"daily", "priority"=>"0.7"],
"file2.html"
];

$sgen=new SimpleSiteMapGenerator();

$sgen->setBaseURL("https://mywebsite");
$sgen->setDestinationPath(".");
$sgen->setDefaultChangeFreq("weekly");
$sgen->setDefaultPriority("0.5");
$sgen->setDefaultChangeFreqIndex("daily");
$sgen->setDefaultPriorityIndex("0.9");

$sgen->generateSiteMapXML($pages);
$sgen->generateSiteMapTXT($pages);