📌  相关文章
📜  获取一个月的所有日期 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:37.700000             🧑  作者: Mango

代码示例1
get all of dates ( day ) from a month...

$month = '2015-01';
$start = Carbon::parse($month)->startOfMonth();
$end = Carbon::parse($month)->endOfMonth();

$dates = [];
while ($start->lte($end)) {
     $dates[] = $start->copy();
     $start->addDay();
}

echo "
", print_r($dates), "
";