日期范围之间的活动日计数

I am having some trouble with date calculation. I will try to explain it as much as i can;

Let's say you have an advertising billboard, and this medium has active date range. For example, the start of the active term is 01 December of every year, and the end of the active term is 01 March of every year.

Consider that you are renting this billboard to someone for a certain time period. Example daterange is 01 February 2017 to 10 December 2020. In this period, how can i calculate the billable date count? Trying to do it with php but stucked. Anyone can help me to do it without having too many "if" clauses?

edit:

    $activeTermStart = "01/12"; // 'd/m'
    $activeTermEnd = "01/03"; // 'd/m'

    $daterangeStart = new \DateTime('2017-02-01');
    $daterangeEnd = new \DateTime('2020-12-10');

    //check if active term start&end have year diff
    $hasYearDiffBetweenTermStartAndEnd = false;

    $startArray = explode('/',$activeTermStart);
    $endArray = explode('/',$activeTermEnd);
    if ($startArray[1]>$endArray[1]) {
        $hasYearDiffBetweenTermStartAndEnd = true;
    }
    if ($startArray[1]==$endArray[1] && $startArray[0]>=$endArray[0]) {
        $hasYearDiffBetweenTermStartAndEnd = true;
    }

    $startTermWithYear = \DateTime::createFromFormat('d/m/Y',$activeTermStart.'/'.date('Y'));
    $startTermWithFirstYear = \DateTime::createFromFormat('d/m/Y',$activeTermStart.'/'.$daterangeStart->format('Y'));
    if ($hasYearDiffBetweenTermStartAndEnd) {
        $endTermWithYear = \DateTime::createFromFormat('d/m/Y',$activeTermEnd.'/'.(date('Y')+1));
        $endTermWithFirstYear = \DateTime::createFromFormat('d/m/Y',$activeTermEnd.'/'.((int)$daterangeStart->format('Y')+1);
    } else {
        $endTermWithYear = \DateTime::createFromFormat('d/m/Y',$activeTermEnd.'/'.date('Y'));
        $endTermWithFirstYear = \DateTime::createFromFormat('d/m/Y',$activeTermEnd.'/'.$daterangeStart->format('Y'));
    }

    $maximumBillableDaysPerYear = ($endTermWithYear->getTimestamp() - $startTermWithYear->getTimestamp())/60/60/24;

    $totalYearsToCheck = ((int)$daterangeEnd->format('Y') - (int)$daterangeStart->format('Y'))+1;

    $maximumBillableDaysTotal = $totalYearsToCheck *  $maximumBillableDaysPerYear;

    // from that moment on, i want to see how many days are not in the first year and
    // how many days are not in the last year. Remove them from the maximumBillableDaysTotal to
    // see how many days that billboard is billable for.
    // stucked here...