欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

求个PHP列出周日期代码

程序员文章站 2024-02-18 09:36:10
...
看图片吧,这种列表用PHP怎么写呢?求高人帮帮忙~

回复讨论(解决方案)

".date("Y年m月d日",strtotime($k." days"));echo "
";}?>


代码写得很粗糙

$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'.$ar[$i]."\n";	}

for($i=0,$t=-7; $i ', strtotime("$t day"));  echo date('Y-m-d', strtotime(($t+7)."day")) . '
';}

谢谢各位啦...

for($i=0,$t=-7; $i ', strtotime("$t day"));  echo date('Y-m-d', strtotime(($t+7)."day")) . '
';}

!~