📜  使用碳获取最近 3 个日期的数组 - PHP 代码示例

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

代码示例2
$period = CarbonPeriod::create('2018-06-14', '2018-06-20');

// Iterate over the period
foreach ($period as $date) {
    echo $date->format('Y-m-d');
}

// Convert the period to an array of dates
$dates = $period->toArray();