求个PHP列出周末期代码

求个PHP列出周日期代码看图片吧,这种列表用PHP怎么写呢?求高人帮帮忙~[解决办法]$s2013-05-31$current

求个PHP列出周日期代码
求个PHP列出周末期代码

看图片吧,这种列表用PHP怎么写呢?求高人帮帮忙~
[解决办法]

$s='2013-05-31';
$current=date("Y-m-d");
while($current>=$s){
    $ar[]=$current;
$current=date("Y-m-d",strtotime("$current -7 day"));
}
for($i=0;$i<count($ar)-1;$i++){
   echo $ar[$i+1].'->'.$ar[$i]."\n";
}

[解决办法]
for($i=0,$t=-7; $i<20; $i++,$t-=7) {
  echo date('Y-m-d -> ', strtotime("$t day"));
  echo date('Y-m-d', strtotime(($t+7)."day")) . '<br>';
}