当前位置:网站首页 - 特效代码 - PHP编程
  • $dqtime =time()+28800; $basetime="2009-11-14 16:26:20"; $datebasetime=strtotime($basetime); $timecha=$dqtime-$datebasetime; if ($timecha<60) { echo $timecha."秒前"; } elseif($timecha>=60 &&$timecha <3600) { echo ceil($timecha/60)."分前"; } elseif($timecha>=3600&&$timecha<86400) { echo ceil($timecha/3600)."小时前"; } else { echo ceil($timecha/86400)."天前"; }