Last date of this month
echo date("Y-m-d",strtotime("+1 month -1 second"),strtotime(date("Y-m-1")));
Last date of next month
echo date("Y-m-d",strtotime("+2 month -1 second"),strtotime(date("Y-m-1")));
Last date of previous month
echo date("Y-m-d",strtotime("-1 second"),strtotime(date("Y-m-1


