Current Article:

How to find the last day of the month in PHP?

How to find the last day of the month in PHP?

Easy to do using the DateTime class:

$date = new DateTime('now');
$date->modify('last day of this month');
echo $date->format('Y-m-d');