<?php function calculateDateDiff($start_date, $end_date) { $diff = date_diff(new DateTime($end_date), new DateTime($start_date)); echo "month: $diff->m, day: $diff->d "; } calculateDateDiff('2016-01-14', '2016-06-12'); echo "\n"; calculateDateDiff('2017-02-14', '2018-01-12'); echo "\n"; […]