date('Y-m-01', strtotime('last month'));
date('Y-m-t', strtotime('last month'));
$lastDay = date('t',strtotime('last month'));
print_r($lastDay);
$lastDateOfNextMonth =strtotime('last day of next month') ;
$lastDay = date('d/m/Y', $lastDateOfNextMonth);
print_r($lastDay);
<?php
// First day of this month
$d = new DateTime('first day of this month');
echo $d->format('jS, F Y');
?>
$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'));
$first_day_this_month = date('m-01-Y'); // hard-coded '01' for first day
$last_day_this_month = date('m-t-Y');
//Last month
$lastMonth = Date("F", strtotime("first day of previous month");
$nextMonth = Date("F", strtotime("first day of next month");
$config_month = 1;
$config_day = 1;
$new_expiry_date = date('Y-m-d', mktime(0, 0, 0, date('m') + $config_month, 1 + $config_day, date('Y')));
$firstOfMonth = date('Y-m-01');
$lastOfMonth = date('Y-m-t');