The other day I was working on a time sheet application that I was looping through a Unix time stamp for a defined number of days. For this project I was working with the number of seconds between days and just incrementing the value by the total number of seconds in a day like:
//$startDay is a Unix time stamp of the start of my loop
//$endDay is a Unix time stamp for when the loop needs to end
$plusDay = 60*60*24; //Number of seconds in a day this could be set as 86400
for($day=$startDay;$day<=$endDay;$day+=$plusDay){
$showDay = date( 'm/d/Y', $day );
echo $showDay . "<br />\n";
}
The other day I was working on a time sheet application that I was looping through a Unix time stamp for a defined number of days. For this project I was working with the number of seconds between days and just incrementing the value by the total number of seconds in a day like:
//$startDay is a Unix time stamp of the start of my loop
//$endDay is a Unix time stamp for when the loop needs to end
$plusDay = 60*60*24; //Number of seconds in a day this could be set as 86400
for($day=$startDay;$day<=$endDay;$day+=$plusDay){
$showDay = date( 'm/d/Y', $day );
echo $showDay . "<br />\n";
}