我的时间显示有问题
这是我的代码
<?php
header("Content-Type: application/xml; charset=utf-8");
error_reporting(E_ERROR);
include('include/config.php');
include('include/connect.php');
include('include/functions.php');
include('include/setting.php');
include('include/general.class.php');
$general = new General;
$general->set_connection($mysqli);
$general_setting = $general->get_options('General');
$siteurl = $general_setting['siteurl'];
$today = date('Y-m-d');
$sitename = ('test.com');
$NumberKeyword = 5000;
$query = $mysqli->query("SELECT `word` FROM `2001` ORDER BY `2001`.`id` DESC limit $NumberKeyword");
while($row = $query->fetch_assoc())
{
$url = $sitename."/post?q=".str_replace('-', '+', slugit($row['word']));
$slugged = str_replace(':/','://',str_replace('//','/',($url)));
$sitemap .= "<url>";
$sitemap .= "<loc>$slugged</loc>";
$sitemap .= "<lastmod>". $row['regdate'] ."</lastmod>";
$sitemap .= "<changefreq>daily</changefreq>";
$sitemap .= "<priority>0.8</priority>";
$sitemap .= "</url>";
}
$sitemap .= "</urlset>";
echo $sitemap;
?>
和此演示:
这是我的数据库:
我想在站点地图上显示regdate(datebase)
但是代码不起作用
我添加了。 $ row ['regdate']。 但是没有用