标签:
function get_long_time($date){ $curr = time(); $date = strtotime($date); $tmp = $curr - $date; if($tmp < 60){ $re = $tmp.‘秒前‘; }else if($tmp < 3600){ $re = floor($tmp/60).‘分钟前‘; }else if($tmp < 86400){ $re = floor($tmp/3600).‘小时前‘; }else if($tmp < 259200){//3天内 $re = floor($tmp/86400).‘天前‘; }else{ $re = date(‘m月d日‘,$date); } echo $re; }
标签:
原文地址:http://www.cnblogs.com/adtuu/p/4688266.html