打印恋爱纪念日日期
代码片
.
//关键天数数组
$dayArr = [99,100,199,200,299,300,399,400,499,500,599,600,699,700,799,800,899,900,999,1000];
//准确周几
$cfg_week = ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'];
// 计算在一起的天数纪念日日期
$date = '2018-05-27';//日期
foreach ($dayArr as $key => $value) {
$MemorialDate = date('Y-m-d',strtotime("+$value DAY $date"));
$week_idx = date('w', strtotime($MemorialDate)); //记录时间所处星期几(索引,0开始[星期天])
$ret = $value.'天 '.date('Y年m月d日',strtotime("+$value DAY $date")).' '.$cfg_week[$week_idx].'<br>';
echo $ret;//打印数据
}