1、枚举两个日期中间的所有日期
<?php
function prDates($start, $end)
{
$dt_start = strtotime($start);
$dt_end = strtotime($end);
$temp = [];
while ($dt_start <= $dt_end) {
$re = date('Y-m-d', $dt_start);
$temp[] = $re;
$dt_start = strtotime('+1 day', $dt_start);
}
return $temp;
// 返回data型数据
}
2、获取两个日期之间的天数
<?php
function countData($Date_1, $Date_2)
{
$d1 = strtotime($Date_1);
$d2 = strtotime($Date_2);
$Days = ($d1 - $d2) / 3600 / 24;
return $Days;
// 返回int型数据
}
--------------------------------------------------------------------
承接网站开发、小程序开发、app开发、商城开发、公众号开发。
百度SEO排名、百度搜索霸屏、软文代写等业务。
联系QQ:2779459018 联系微信:qianxia39