- var_dump: documentation ( source)
- date: documentation ( source)
- sprintf: documentation ( source)
<?php
$t=date('Y');
$q = date('m');
for($e=$q;$e<=($q+2);$e++){
$ren = $t.'-'. sprintf("%'.02d\n", $e);
var_dump($ren);
}
$begin = new DateTime( '2016-01-11' );
$numMonths = 3;
for($i=0; $i<$numMonths; $i++)
{
var_dump($begin->modify( '+1 month' )->format("Y-m-d"));
}