$day = “10/12/2022”; $date_parts = explode(‘/’, $day); $last_day_of_next_month = date(‘d/m/Y’, mktime(0, 0, 0, $date_parts[1] + 1, 0, $date_parts[2])); return $last_day_of_next_month;