解决方案 »
- 如何生成永不重复的账号,搜狐快速回复、用户名是如何生成的
- 请教一下提交按钮的问题
- 怎么我装的phpstduy打不开?
- 我的服务器放在防火墙的DMZ区,服务器上通过$_SERVER['REMOTE_ADDR']取不到访问者的IP,取的是防火墙的公网IP?
- PHP函数变量里面类似mysql_connect为什么不能赋给变量使用呢?
- php编程高手,请帮忙解决一个问题:
- 代码没看懂 请高手帮解释下!! 谢谢了
- parse error, unexpected T_ELSE 请教达人,怎么解决
- 问大家一个问题.相当简单....................
- 关于用户认证的问题
- dreamweaver連接mysql數據庫連接不上
- 关于PHP正则表达式提取远程页面中的Table内容
{ $data_array['loc']="http://zufang.sslook.com/sh/$ran/$row[0]";
$data_array['priority']='1.0';
$data_array['lastmod']='2012-12-12';
$data_array['changefreq']='weekly';
}
这个while再次循环时,数组值data_array又被覆盖了,所以最终就一个值了,添加flag
改为以下,都是hhh什么意思,数据库里东西吗,发出来看一下$i= 0;
while($row = mysql_fetch_array($result))
{ $data_array[$i]['loc']="http://zufang.sslook.com/sh/$ran/$row[0]";
$data_array[$i]['priority']='1.0';
$data_array[$i]['lastmod']='2012-12-12';//这些都被你定死了
$data_array[$i]['changefreq']='weekly';
++$i;
}
<?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">
<url>
<loc>h</loc>
<priority>h</priority>
<lastmod>h</lastmod>
<changefreq>h</changefreq>
</url>
<url>
<loc>1</loc>
<priority>1</priority>
<lastmod>1</lastmod>
<changefreq>1</changefreq>
</url>
<url>
<loc>2</loc>
<priority>2</priority>
<lastmod>2</lastmod>
<changefreq>2</changefreq>
</url>
<url>
<loc>w</loc>
<priority>w</priority>
<lastmod>w</lastmod>
<changefreq>w</changefreq>
</url>
</urlset>奇怪吧,就搞不懂这个是怎么回事。
echo "<pre>";
print_r($data_array);