I want to get previous month first date and last date.
$first_date = strtotime('first day of previous month', time());
$previous_month_first_date=date('Y-m-d', $first_date);
$previous_month_last_date=date('Y-m-d', strtotime('last day of previous month'));
=> Try this code I hope it's useful ..
echo date('Y-m-d', strtotime('first day of last month'));
echo "<br/>";
echo date('Y-m-d', strtotime('last day of last month'));
Output:- https://eval.in/925253
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With