php strotime';第三天+;1个月';=假的
我想要一个这样的循环: 此循环正常:php strotime';第三天+;1个月';=假的,php,strtotime,Php,Strtotime,我想要一个这样的循环: 此循环正常: while($d<=$d2) { $x = "first day of + 1 month"; $d=strtotime($x,$d); do_something($d); } while($d未指定一周中的某一天,只有第一天和最后一天使用“+x个月”。使用strotime只需使用两次。例如: $d1= strtotime('first day of + 1 month',$d)
while($d<=$d2) {
$x = "first day of + 1 month";
$d=strtotime($x,$d);
do_something($d);
}
while($d未指定一周中的某一天,只有第一天和最后一天使用“+x个月”。使用strotime只需使用两次。例如:
$d1= strtotime('first day of + 1 month',$d);
$day = 3;
$dateStr = date("Y-m-",$d1).sprintf("%02d",$day);
$d = strtotime($dateStr);
谢谢,它在工作。
$d1= strtotime('first day of + 1 month',$d);
$day = 3;
$dateStr = date("Y-m-",$d1).sprintf("%02d",$day);
$d = strtotime($dateStr);