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