📜  php 日期循环 - PHP 代码示例

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

代码示例1
$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
}