I have to calculate the number of days that have passed between two dates, but I need to split the days difference per month and just display the current month passed days. This is needed to calculate vacations time for an employee.
Note: I need to make this on PHP 5.4. For example I'm going to use this two dates and a current month:
<?php
CurrentMonth="04";
FirstDate="2021-03-28";
SecondDate="2021-04-15";
?>
So, for this example the total day diff is 18 days, but I just need to return the 15 days passed in the current month "04".
Any suggestions? Thanks in advance.