Skip to content

tanvirismail/php-xml-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

php-xml-generator

Instance Class

  require_once "sitemap-generator.php";
  $sitemap = new Sitemap;

If you skip any url

  $sitemap->skip(["https://www.lipsum.com/skip"]);

if you set priority. default priority is 1.0

  $sitemap->priority("1.0");

if you set frequency. default frequency is daily

  $sitemap->frequency("weekly");

set crewl url

  $sitemap->url("https://www.lipsum.com/");

Output

if you output only url in array

  $scan = $sitemap->scan();
  
  echo '<pre>';
  print_r ($scan);

if you output xml formated data in array

  $render = $sitemap->render();
   
  echo '<pre>';
  print_r ($render);

if you output xml file

  header('Content-Type: text/xml; charset=utf-8');
  echo $sitemap->makeXML();

if you force download

  $sitemap->download(); // filename is sitemap.xml
  or
  $sitemap->download('filename.xml');

if you save file your directory

  $sitemap->save(); // filename is sitemap.xml
  or
  $sitemap->save('filename.xml');

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages