求个PHP列出周日期代码 看图片吧,这种列表用PHP怎么写呢?求高人帮帮忙~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?php//打印周五$week = getdate();//echo $week['wday'];if($week['wday']==5)//echo $week['year'].'年'.$week['mon'].'月'.$week['mday'].'日';//echo $week[year].'年'.$week[mon].'月'.$week[mday].'日';for($i=1;$i<=20;$i++){$j=$i*-7;$k=$j+7;echo date("Y年m月d日",strtotime($j." days"));echo "->".date("Y年m月d日",strtotime($k." days"));echo "<br />";}?>代码写得很粗糙 $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>';} 需求兼职php 程序员,要求对php,oscommerce,joolma 无法将数据加进数据库 简单的正则问题,高分求解 php + FlashPaper 我安装DZ后图片上传失败的问题 谁有类似我们发表新话题这样界面的,要html代码 请问MEDIAWIKI怎么实现根据访问者的IP段不同而显示不同的首页? php 如何把彩色图片转换成黑白的? PHPExcel 编辑xls 悬赏求解 有多个数组. 怎么计算并获得有多少种组合?? smarty有个问题搞的我头大 像大家请教了
//打印周五
$week = getdate();
//echo $week['wday'];
if($week['wday']==5)
//echo $week['year'].'年'.$week['mon'].'月'.$week['mday'].'日';
//echo $week[year].'年'.$week[mon].'月'.$week[mday].'日';for($i=1;$i<=20;$i++)
{
$j=$i*-7;
$k=$j+7;
echo date("Y年m月d日",strtotime($j." days"));
echo "->".date("Y年m月d日",strtotime($k." days"));
echo "<br />";
}
?>代码写得很粗糙
$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";
}
echo date('Y-m-d -> ', strtotime("$t day"));
echo date('Y-m-d', strtotime(($t+7)."day")) . '<br>';
}