I want to get last 3 months name from current month. For example current month is August. So, I want the datas like these June, July, August. I have tried this code echo d
echo d
That should work:
function lastThreeMonths() { return array( date('F', time()), date('F', strtotime('-1 month')), date('F', strtotime('-2 month')) ); } var_dump(lastThreeMonths());