<?php $timedays=strtotime(date("Y-m-d",time()));//今天0点的时间点 $timedaye=$timedays+3600*24;//今天24点的时间点,两个值之间即为今天一天内的数据 $xinxi_sql=$empire->query('select id,title,titleurl from '.$dbtbpre.'ecms_news where newstime>='.$timedays.' and newstime<='.$timedaye.' order by newstime desc limit 10'); while($xinxi_row=$empire->fetch($xinxi_sql)){ ?> <li><a href="<?=$xinxi_row[titleurl]?>"><?=$xinxi_row[title]?></a></li> <? } ?>