gpt4 book ai didi

php - 2 种不同的输出(Chrome 和 IE/FIREFOX)

转载 作者:行者123 更新时间:2023-11-30 01:14:02 26 4
gpt4 key购买 nike

当我像这样加载数据库值时:

<?=$list[time]?>  

在 Chrome 中,输出为:2013-10-07T14:27:56在 Firefox 中,输出为:0000-00-00 00:00:00

这怎么可能?$list[time] 是数据库中的时间戳值。

我的代码:

$lsel_list = mysql_query("select * from users WHERE id = '$id' order by id asc");
while ($list = mysql_fetch_array($lsel_list)) {
echo"$list[time]";
}

字段时间是数据库中带有时间的时间戳。 (2013-10-07 14:28:35)

最佳答案

Try this :
echo date("Y m d",strtotime($list[time]));

关于php - 2 种不同的输出(Chrome 和 IE/FIREFOX),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19225853/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com