I want to output of last and first date of a given month of current year. I am using this code but not works
$month='02';
$first_day_this_month = date('Y-'.$month.'-01'); // hard-coded '01' for first day
$last_day_this_month = date('Y-'.$month.'-t');
echo $first_day_this_month;print'<->';echo $last_day_this_month;
my output shows
2015-02-01<->2015-02-31
But it will be 2015-02-01<->2015-02-28