Re: [請益] 請教一個日期條件設計問題

看板PHP作者 (gary.lusifa)時間6年前 (2018/01/22 18:31), 編輯推噓0(009)
留言9則, 3人參與, 6年前最新討論串4/10 (看更多)
※ 引述《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://www.ptt.cc/bbs/PHP/M.1516617086.A.EC4.html

01/22 19:17, 6年前 , 1F
你php版本。
01/22 19:17, 1F

01/22 21:11, 6年前 , 2F
回moonraker php版本5.2.9
01/22 21:11, 2F

01/22 23:53, 6年前 , 3F
01/22 23:53, 3F

01/23 00:52, 6年前 , 4F
justgame 請問這一個語法5.2.9有支援嗎?
01/23 00:52, 4F

01/23 09:07, 6年前 , 5F
5.2太誇張了 5.6以下都嫌老了 起碼設法升到5.4
01/23 09:07, 5F

01/23 11:28, 6年前 , 6F
回樓上因為這是舊的網站,因為時間緊迫所以先改版,再換版
01/23 11:28, 6F

01/23 11:29, 6年前 , 7F
另外我也是剛開始學習,如果有建議可以提出感謝
01/23 11:29, 7F

01/23 15:37, 6年前 , 8F
沒有其他建議,建議就是叫你升級。原因應該是不用講
01/23 15:37, 8F

01/23 15:38, 6年前 , 9F
反正你不像有興趣的樣子。
01/23 15:38, 9F
文章代碼(AID): #1QPRr-x4 (PHP)
討論串 (同標題文章)
以下文章回應了本文
完整討論串 (本文為第 4 之 10 篇):
文章代碼(AID): #1QPRr-x4 (PHP)