PHP code example of uzzzer2pac / sitemap
1. Go to this page and download the library: Download uzzzer2pac/sitemap 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/ */
uzzzer2pac / sitemap example snippets
Uzzzer2pac\Sitemap\SitemapGenerator;
try {
(new SitemapGenerator($data, $path, $format))->createSitemap();
} catch (\Throwable $e) {
print($e->getMessage());
}
[
[
'loc' => 'http://avito.ru',
'lastmod' => '2020-12-14',
'priority' => '1',
'changefreq' => 'hourly',
],
[
'loc' => 'http://avito.ru/b',
'lastmod' => '2020-12-15',
'priority' => '1',
'changefreq' => 'hourly',
],
[
'loc' => 'http://avito.ru/a',
'lastmod' => '2020-12-11',
'priority' => '1',
'changefreq' => 'hourly',
],
];
[
'loc' => Валидный URL,
'lastmod' => DDDD-M-Y,
'priority' => 0 - 1,
'changefreq' => always|hourly|daily|weekly|monthly|yearly|never,
],
Uzzzer2pac\Sitemap\SitemapItem\SitemapBaseFormat::CHANGE_FREQ_ALWAYS,
Uzzzer2pac\Sitemap\SitemapItem\SitemapBaseFormat::CHANGE_FREQ_HOURLY,
Uzzzer2pac\Sitemap\SitemapItem\SitemapBaseFormat::CHANGE_FREQ_DAILY,
Uzzzer2pac\Sitemap\SitemapItem\SitemapBaseFormat::CHANGE_FREQ_WEEKLY,
Uzzzer2pac\Sitemap\SitemapItem\SitemapBaseFormat::CHANGE_FREQ_MONTHLY,
Uzzzer2pac\Sitemap\SitemapItem\SitemapBaseFormat::CHANGE_FREQ_YEARLY,
Uzzzer2pac\Sitemap\SitemapItem\SitemapBaseFormat::CHANGE_FREQ_NEVER,
/absolute/path/to/file.extension
Uzzzer2pac\Sitemap\SitemapItem\SitemapBaseFormat::FORMAT_JSON,
Uzzzer2pac\Sitemap\SitemapItem\SitemapBaseFormat::FORMAT_XML,
Uzzzer2pac\Sitemap\SitemapItem\SitemapBaseFormat::FORMAT_CSV,