Re: [请益] 请教一个日期条件设计问题

楼主: kyoe (缘份‧不再)   2018-01-22 12:40:11
<?
$birthday="1911-05-03";
$birthday=date("Y")."-".date("m",strtotime($birthday))."-".date("d",strtotime($birthday));
$start_date = date("Y-m-d", strtotime('last day of -1 month', strtotime($birthday)) );
$end_date = date("Y-m-d", strtotime('last day of 0 month', strtotime($birthday)) );
?>
<p><?echo "$start_date";?></p>
<p><?echo "$end_date";?></p>
这样吗?
作者: lusaka (gary.lusifa)   2018-01-22 18:16:00
我测试一下,感谢您的回复
作者: MOONRAKER (㊣牛鹤鳗毛人)   2018-01-22 19:20:00
$birthday转$birthday太厉害了 奇葩无误

Links booklink

Contact Us: admin [ a t ] ucptt.com