<?php $start_date = new DateTime("2023-01-03"); $end_date = new DateTime("2023-12-15"); while ($start_date <= $end_date) { printf( "%s..%s\n", max($start_date->format("Y-m-01"), $start_date->format("Y-m-d")), min($end_date->format("Y-m-d"), $start_date->format("Y-m-t")) ); $start_date->modify('+1 month first day of'); }
You have javascript disabled. You will not be able to edit any code.