Category: PHP

If you ever need to find the last day of the month in php this is how to do it.

You convert to seconds the current year and month and then let date() function to find what's the last day of that selected month.

    $year = 2024;
    $month = 2;
    $last_day_of_month = date('Y-m-t', strtotime($year . '-' . $month));

Finding the last day can be useful if you want to run some SQL queries or other data that needs a start and an end day.

Join our mailing list

Get important news about cool products we release and invitations to beta test new products

Find out the Social networks we're on