生成网站地图有什么简易的方法吗? 如果你使用的建站程序一般带有生成地图功能,可以用自带的,没有的话自己写,按照生成xml格式的要求写程序生成。具体可以参考如下两篇文章:1.使用codeIgniter生成网站Sitemap2.PHP生成sitemap.xml地图文件的代码参考 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?PHP$content='<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">';$data_array=array( array( 'loc'=>'http://www.phpernote.com/', 'priority'=>'1.0', 'lastmod'=>'2012-06-03T04:20:32-08:00', 'changefreq'=>'always' ), array( 'loc'=>'http://www.phpernote.com/', 'priority'=>'0.5', 'lastmod'=>'2012-06-03T04:20:32-08:00', 'changefreq'=>'daily' ));foreach($data_array as $data){ $content.=create_item($data);}$content.='</urlset>';$fp=fopen('sitemap.xml','w+');fwrite($fp,$content);fclose($fp);function create_item($data){ $item="<url>\n"; $item.="<loc>".$data['loc']."</loc>\n"; $item.="<priority>".$data['priority']."</priority>\n"; $item.="<lastmod>".$data['lastmod']."</lastmod>\n"; $item.="<changefreq>".$data['changefreq']."</changefreq>\n"; $item.="</url>\n"; return $item;} php+mysql实现全文索引程序出错 获取图片ID后怎么传ID到评论页,然后写进评论的数据表? 重启路由器后不能上网,大家帮忙看看,谢谢 擦,php100又被攻破了。。。 怎么点击一个链接文字(add)后.链接文字变为(ok).然后(OK是普通文本.不是链接文本) 急,求助 php中,session变量不能在页面间传递吗?? 取得一个字串首字符最高效的方法是什么? 求购perl写的网页计数器。 php中得到本页url的方法是什么? dom指的是什么 smarty中assign()这个函数是如何定义的 while 的变量传出去不一样?
<?PHP
$content='<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
';
$data_array=array(
array(
'loc'=>'http://www.phpernote.com/',
'priority'=>'1.0',
'lastmod'=>'2012-06-03T04:20:32-08:00',
'changefreq'=>'always'
),
array(
'loc'=>'http://www.phpernote.com/',
'priority'=>'0.5',
'lastmod'=>'2012-06-03T04:20:32-08:00',
'changefreq'=>'daily'
)
);
foreach($data_array as $data){
$content.=create_item($data);
}
$content.='</urlset>';
$fp=fopen('sitemap.xml','w+');
fwrite($fp,$content);
fclose($fp);function create_item($data){
$item="<url>\n";
$item.="<loc>".$data['loc']."</loc>\n";
$item.="<priority>".$data['priority']."</priority>\n";
$item.="<lastmod>".$data['lastmod']."</lastmod>\n";
$item.="<changefreq>".$data['changefreq']."</changefreq>\n";
$item.="</url>\n";
return $item;
}