php計算兩個日期的相差天數,處理時間間隔

舉例:想要獲取 2016-04-10和2016-06-15相差多少天。php $begin_date = strtotime('2016-04-10'); $end_date = strtotime('2016-06-15'); $days = round(($end_date - $begin_date) / 3600 / 24); 其中已經使用strtotime將時間格式化爲時間戳,直接輸出$
相關文章
相關標籤/搜索