$start_time='2006-06-04';
$day=substr($start_time,8,2);
$month=substr($start_time,5,2);
$year=substr($start_time,0,4);for ($i=0,$n=3;$i<$n;$i++)
{
echo date('Y-m-d',mktime(0,0,0,$month+=2,$day,$year));
echo "<br>";
}
$day=substr($start_time,8,2);
$month=substr($start_time,5,2);
$year=substr($start_time,0,4);for ($i=0,$n=3;$i<$n;$i++)
{
echo date('Y-m-d',mktime(0,0,0,$month+=2,$day,$year));
echo "<br>";
}
$str1 = "2006-07-01";
$str2 = "2008-08-04";
for($i = strtotime($str1);$i<=strtotime($str2);)
{
echo date("Y-m-d",$i);
$ar =explode("-",date("Y-m-d",$i));
$i = mktime(0,0,0,$ar[1]+2,$ar[2],$ar[0]);
}?>
$str2 = "2008-08-04";
for($i = strtotime($str1);$i <=strtotime($str2);)
{
echo date("Y-m-d", $i=strtotime("2 months", $i)).'<br>';
}
<?php
echo strtotime("now"), "\n";
echo strtotime("10 September 2000"), "\n";
echo strtotime("+1 day"), "\n";
echo strtotime("+1 week"), "\n";
echo strtotime("+1 week 2 days 4 hours 2 seconds"), "\n";
echo strtotime("next Thursday"), "\n";
echo strtotime("last Monday"), "\n";
?>
只要循环输出就行了.