With the code below I get this results
2015-07-15 10:26:12 2015-08-15 10:26:12
2015-08-15 10:26:12 2015-09-15 10:26:12
2015-09-15 10:26:12 2015-10-15 10:26:12
2015-10-15 10:26:12 2015-11-15 10:26:12
Here is what I want to get as result
2015-07-15 10:26:12 2015-08-15 10:26:12
2015-08-15 10:26:12 2015-08-15 10:26:12
2015-07-15 10:26:12 2015-08-15 10:26:12
2015-08-15 10:26:12 2015-08-15 10:26:12
for ($i = 0; $i < 10; $i++) {
echo $time->format('Y-m-d h:i:s') . $time->modify('+1 month')->format('Y-m-d h:i:s');
}
So is it possible to reset datetime object on every loop?