愚者樹屋

|
Home About Contact
|

series

3d軟體 (1) apache (1) css (4) 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) 遊戲推薦 (4) 雜記 (1)

Tags

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

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) 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) 遊戲推薦 (4) 雜記 (1)

Tags

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

Recent Posts

javascript 統一編號檢查

2023/12/17

mysql 合併查詢

2024/04/04

使用yt-dlp下載需登入的嵌入式vimeo影片

2024/06/22

用jmeter進行壓力測試2 下載其他資源

2023/05/06

css 動態計算功能

2023/10/15

mastodon misskey pixiv plurk twitter 巴哈姆特

© 2022-2025 愚者樹屋