Jump to content

for loop strtotime


l0ve2hat3

Recommended Posts

<?php
$collection_date=1258434000;
$closing_date=1273172751;
for($date_posted=$collection_date;$date_posted<$closing_date;$date_posted=strtotime(date('m/d/Y',$date_posted)." +1 day")){
    echo date('m/d/y',$date_posted)."<br>";
}
?>

OUTPUT

11/17/09
11/18/09
11/19/09
11/20/09
11/21/09
11/22/09
11/23/09
11/24/09
11/25/09
11/26/09
11/27/09
11/28/09
11/29/09
11/30/09
12/01/09
12/02/09 etc...

 

WHY IS IT SKIPPING THE 31st??

 

 

Link to comment
https://forums.phpfreaks.com/topic/200923-for-loop-strtotime/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.