I am going through the answer of this question in order to loop through first and last day of the current month in php.
I copy-pasted the same code from the answer of the above question but it doesn't seems to return anything (blank).
<?php
$current_month_first_day = date('Y-m-01'); // first day of the current month
$current_month_last_day = date('m-t-Y'); // last day of the current month
$interval = DateInterval::createFromDateString('1 day');
$period = new DatePeriod($current_month_first_day, $interval, $current_month_last_day);
?>
Problem Statement:
I am wondering what changes I should make in the php code above so that it shows the list of dates from (February 1st to February 29th) for the current month. My code will show dates in input format.