- 方法一:
- <?
- //$db->rows[$i][date]中为数据库中datetime字段值.
- $today=time();
- $theDay=date("Y-m-d H:i:s",$today-24*3600);
- $newTag=$db->rows[$i][date]>=$theDay?"<img src='../image/newinfor.gif'>":"";
- //oSPHP.COM.CN
- //方法二:
- $newTag=$db->rows[$i][date]>=date("Y-m-d 00:00:00")?"<img src='../image/newinfor.gif'>":"";
- ?>
- //该片段来自于http://www.codesnippet.cn/detail/010420132644.html
来源: http://www.codesnippet.cn/detail/010420132644.html