Loading...

使用PHP取得指定月份最後一天的日期

Temperature: 0 °C

Mark ChangMark Chang
author_tools

使用PHP要如何抓某個月份的最後一天
例如抓本月份的話可以使用下列範例:

date('Y-m-t', strtotime('now'));

若要抓某個特定月份的最後一天呢?例如2022-01-01
這時,只要把上述範例中的now更改為指定日期即可。
如下列範例:
date('Y-m-t', strtotime('2022-01-01'));

以上紀錄~

#故事  #PHP  #抓每月最後一天日期  
https://innstory.com/story-使用PHP取得指定月份最後一天的日期-3149
PHP

Prev
 javascript如何通過其_ID_設置選擇元素的選定選項

About the Author

Mark Chang

離不開電腦的宅男

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

分享 斜槓青年正夯,什麼都會才是王道?他舉賈伯斯、巴菲特為例,勸你萬萬不可跨領域-風傳媒

分享 斜槓青年正夯,什麼都會...

巴菲特:「了解自己的能力圈,待在裡面。這個圈圈到底有多大其實無關緊要。知道圈圈的邊線究竟在哪則非常重...

PDO常用方法

pexelsphoto555.jpeg PDO::query() 主要用於有記錄結果返回的操作(PD...

設定Postfix使用SMTP Server當作relay主機

設定Postfix使用SMT...

在/etc/postfix/main.cf 裡修改relayhost 將#relayhost = [...

Please select an option

error

Hi, thank you for your participation, but you cannot vote repeatedly~

Join innstory now and start recording your story.

"Innstory" is a place to store stories. We are committed to becoming a warm platform. Deepening the bonds between people is our direction.
We are convinced that the blockchain between people is not just a cold calculation. Join us now.

Wrong format