Php website map generation Class example. Copy the code as follows: includeclassincludeSitemapGenerator. php; createobject $ sitemapnewSitemapGenerator (www.jb51.net); addurls $ sitemap-addUrl (ht
The code is as follows:
// Include class
Include 'sitemapgenerator. php ';
// Create object
$ Sitemap = new SitemapGenerator ("http://www.jb51.net ");
// Add urls
$ Sitemap-> addUrl ("http://your.jb51.net", date ('C'), 'Daily ', '1 ');
$ Sitemap-> addUrl ("http://your.jb51.net", date ('C'), 'Daily ', '0. 5 ');
$ Sitemap-> addUrl ("http://your.jb51.net", date ('C'), 'Daily ');
// Create sitemap
$ Sitemap-> createSitemap ();
// Write sitemap as file
$ Sitemap-> writeSitemap ();
// Update robots.txt file
$ Sitemap-> updateRobots ();
// Submit sitemaps to search engines
$ Sitemap-> submitSitemap ();
The http://www.bkjia.com/PHPjc/695104.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/695104.htmlTechArticle code is as follows: // include class include 'sitemapgenerator. php '; // create object $ sitemap = new SitemapGenerator ("http://www.jb51.net"); // add urls $ sitemap-addUrl ("ht...