标签: php laravel date
2019-03-01至2019-04-04删除两个日期之间的星期六和星期日,并计算总天数
答案 0 :(得分:2)
来自Carbon Docs
CarbonPeriod::macro('countWeekdays', function () { return $this->filter('isWeekday')->count(); }); echo CarbonPeriod::create('2019-03-01', '2019-04-04')->countWeekdays();