Giving a starting date, I\'m adding four times seven days to get 5 different dates separated exactly a week each one.
//$date = \'28-10-2010\';
$timestamp = mkti
I will never understand why people use this horrible mktime
function.
In case you are on PHP5.3 yet, you might want to consider using
$period = new DatePeriod(
new DateTime('28-10-2010'),
DateInterval::createFromDateString('1 week'),
4);
foreach ( $period as $dt ) {
echo $dt->format( "l Y-m-d H:i:s\n" );
}
Without PHP5.3 you can still use
for($i=0; $i<=4; $i++) {
echo date('Y-m-d', strtotime("+$i weeks 28-10-2010")), PHP_EOL;
}
DateTime questions are pretty common on SO, so you might find interesting cases when searching.