📜  php 循环遍历开始和结束日期 - PHP 代码示例

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

代码示例2
$startTime = strtotime( '2010-05-01 12:00' );
$endTime = strtotime( '2010-05-10 12:00' );

// Loop between timestamps, 24 hours at a time
for ( $i = $startTime; $i <= $endTime; $i = $i + 86400 ) {
  $thisDate = date( 'Y-m-d', $i ); // 2010-05-01, 2010-05-02, etc
}