php 日期 - 计算2个日期的差值
1 /** 2 * 日期-计算2个日期的差值 3 * @return int 4 */ 5 public function get_difference($date, $new_date) { 6 $date = strtotime($date); 7 $new_date = strtotime($new_date); 8 return abs(ceil(($date - $new_date)/86400)); 9 }
1 /** 2 * 日期-计算2个日期的差值 3 * @return int 4 */ 5 public function get_difference($date, $new_date) { 6 $date = strtotime($date); 7 $new_date = strtotime($new_date); 8 return abs(ceil(($date - $new_date)/86400)); 9 }