Re: [請益] 請問本周第一天的求法?
※ 引述《longman (@_@)》之銘言:
: ※ 引述《sekihusky (屎面人)》之銘言:
: : 請問,
: : 我查網路上資料有關行事歷寫法的細節時
: : 大部份教學是教求本月第一天是星期幾等
: : 若我需要是本週第一天是幾月幾日的話
: : 有沒有簡單的寫法ㄚ,
: : 我寫了八十多行才算出@_@
: : 應該有更簡單的寫法吧,請各位賜教,感激不盡
: date
: http://tw.php.net/manual/en/function.date.php
: N ISO-8601 numeric representation of the day of the week
: (added in PHP 5.1.0)
: 1 (for Monday) through 7 (for Sunday)
: w Numeric representation of the day of the week
: 0 (for Sunday) through 6 (for Saturday)
: 用date查到今天與星期一差幾,time減扣回幾個24小時的secs,再date
: 這是入門等級的題目..不能自己都不想呀.
謝謝指教,
我就是不太會用時間搓記的用法,所以想找比較快的寫法
不過我剛剛查到在date中始用strtotime就可以辦到了
試過之後覺得省事很多, 腦袋也比較不會打結^_^
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.229.61.67
討論串 (同標題文章)
PHP 近期熱門文章
PTT數位生活區 即時熱門文章