Quantcast
Viewing latest article 6
Browse Latest Browse All 10

PHP: Find the last day of the month

In PHP you can pass the t format character to the date() function in order to get the number of days in the month. Since this number also happens to be the date of the last day of the month, you can use this to your advantage:

Get the last day of the current month:

Get the last day of the month a timestamp falls in:



Viewing latest article 6
Browse Latest Browse All 10

Trending Articles