date('Y-m-01', strtotime('last month'));
date('Y-m-t', strtotime('last month'));
// First date of the month.
$monthFirstDate = date('Y-m-01', strtotime('today'));
// Last date of the month.
$monthLastDate = date('Y-m-t', strtotime('today'));
// Second last date of the month
$monthLastSecondDate = date('Y-m-d', strtotime('-2 day', strtotime('today')));
$lastDay = date('t',strtotime('last month'));
print_r($lastDay);
$currentMonth = date('M');// if number, then date('m');
//Last month
$lastMonth = Date("F", strtotime("first day of previous month");
$nextMonth = Date("F", strtotime("first day of next month");
$lastDateOfNextMonth =strtotime('last day of next month') ;
$lastDay = date('d/m/Y', $lastDateOfNextMonth);
print_r($lastDay);
$a_date = "2009-11-23";
echo date("Y-m-t", strtotime($a_date));
$first = date('Y-m-01', strtotime('last month'));
$last = date('Y-m-t', strtotime('last month'));
//Last month
$lastMonth = Date("F", strtotime("first day of previous month");
$nextMonth = Date("F", strtotime("first day of next month");
$lastOfMonth = date('Y-m-t');
if(gmdate('t') == gmdate('d')){
echo 'Last day of the month.';
}