[PHP] 纯文本查看 复制代码 <?php $dom = new DOMDocument("1.0", "utf-8"); header("Content-Type: text/xml"); $root = $dom->createElement("urlset"); $dom->appendChild($root); for ($i = 0; $i <= 998; $i++) { $track = $dom->createElement("url"); $root->appendChild($track); $loc = $dom->createElement("loc"); $track->appendChild($loc); $lastmod = $dom->createElement("lastmod"); $track->appendChild($lastmod); $changefreq = $dom->createElement("changefreq"); $track->appendChild($changefreq); $priority = $dom->createElement("priority"); $track->appendChild($priority); $text = $dom->createTextNode('http://www.baidu.com/' . (mt_rand(1,20)) . ($i+1) . '.html'); $loc->appendChild($text); $date = date("Y-m-d", strtotime('-' . rand(0,10) . 'day')); $text = $dom->createTextNode($date); $lastmod->appendChild($text); $text = $dom->createTextNode(daily); $changefreq->appendChild($text); $text = $dom->createTextNode(0.8); $priority->appendChild($text); } $dom->save("sitemap.xml"); exit; |
本站所有工具纯属免费共享,请学会感恩作者,无脑喷子永封IP段+删帐号所有评论 不喜欢请右上角X
上一篇:资深运营官教小白如何入手产品运营? 下一篇:百度诊站已上线,网站健康诊断专业工具