PHP计算两个日期之间周末天数
小代码,随便写写,时间复杂度空间复杂度就不纠结了吧
1
2
3
4
5
6 public function getWeekendDays($fromDate,$toDate)
{
$start_z = date('z',strtotime($fromDate));
$end_z = date('z',strtotime($toDate));
$weeksOffset = ($end_z/7) - ($start_z/7);
$start_N = date('N', strtotime($fromDate));[......]<p class="read-more"><a href="https://www.powerrc.net/php%e8%ae%a1%e7%ae%97%e4%b8%a4%e4%b8%aa%e6%97%a5%e6%9c%9f%e4%b9%8b%e9%97%b4%e5%91%a8%e6%9c%ab%e5%a4%a9%e6%95%b0.html">继续阅读</a></p>
近期评论