愚者樹屋

|
Home About Contact
|

series

3d軟體 (1) apache (1) css (4) eagle (1) godot (8) google-api (1) google翻譯 (1) html (6) hugo安裝 (7) javasciprt (1) javascript (14) jquery (3) mysql (9) notepad++ (1) php (33) python (1) unity (1) yt-dlp (1) 像素畫 (1) 免費軟體 (8) 壓力測試 (2) 弱點掃描修補 (1) 無障礙網站 (1) 社群網站 (1) 遊戲推薦 (5) 雜記 (1)

Tags

2d軟體 3d軟體 ai apache css eagle godot google-api google翻譯 html hugo javasciprt javascript jquery mysql notepad++ php python tcpdf unity

php取得星期幾

post date - 2023/11/11
last update - 2023/11/11

第一次碰到了需要在固定星期幾執行的功能,順便做個紀錄。

方法

date中就有參數可以取得

date("N");//1(星期一)到 7(星期天)
date("w");//0(星期天)到 6(星期六)

字串的判斷先產生日期格式然後再取出

    $dtime = DateTime::createFromFormat("2000-01-01", date("Y-m-d"));
    echo $dtime->format('N');

參考資料

https://www.php.net/manual/en/datetime.format.php

Tags : php

series

3d軟體 (1) apache (1) css (4) eagle (1) godot (8) google-api (1) google翻譯 (1) html (6) hugo安裝 (7) javasciprt (1) javascript (14) jquery (3) mysql (9) notepad++ (1) php (33) python (1) unity (1) yt-dlp (1) 像素畫 (1) 免費軟體 (8) 壓力測試 (2) 弱點掃描修補 (1) 無障礙網站 (1) 社群網站 (1) 遊戲推薦 (5) 雜記 (1)

Tags

2d軟體 3d軟體 ai apache css eagle godot google-api google翻譯 html hugo javasciprt javascript jquery mysql notepad++ php python tcpdf unity

Recent Posts

php資料夾權限

2023/01/08

php tcpdf 字形

2023/12/02

firefox couldn't load xpcom 錯誤

2024/04/26

javascript加密

2022/06/11

使用python錄TwitCasting直播

2022/07/30

mastodon misskey pixiv plurk twitter 巴哈姆特

© 2022-2026 愚者樹屋