作者lusaka (gary.lusifa)
標題Re: [請益] 請教一個日期條件設計問題
時間Mon Jan 22 18:31:23 2018
※ 引述《kyoe (緣份‧不再)》之銘言:
: <?
: $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>
: 這樣嗎?
kyoe大大您好
感謝您提供您提供思路,但是顯示的結果如下:
$start_date = 1970-01-01
$end_date = 1970-01-01
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.255.79.52
※ 文章網址: https://webptt.com/m.aspx?n=bbs/PHP/M.1516617086.A.EC4.html
1F:→ MOONRAKER: 你php版本。 01/22 19:17
2F:→ lusaka: 回moonraker php版本5.2.9 01/22 21:11
4F:→ lusaka: justgame 請問這一個語法5.2.9有支援嗎? 01/23 00:52
5F:→ MOONRAKER: 5.2太誇張了 5.6以下都嫌老了 起碼設法升到5.4 01/23 09:07
6F:→ lusaka: 回樓上因為這是舊的網站,因為時間緊迫所以先改版,再換版 01/23 11:28
7F:→ lusaka: 另外我也是剛開始學習,如果有建議可以提出感謝 01/23 11:29
8F:→ MOONRAKER: 沒有其他建議,建議就是叫你升級。原因應該是不用講 01/23 15:37
9F:→ MOONRAKER: 反正你不像有興趣的樣子。 01/23 15:38