<?php
$f=$_POST['rdate'];
echo $f."</br>";
$from=$f.'-01 00:00:00';
$dayyy=explode("-",$f);
//print_r($dayyy);
$year=$dayyy[0];
echo $year."</br>";
$mm=$dayyy[1];
echo $mm."</br>";
$mons = array("01" => "Janauary", "02" => "February", "03"=>"March", "04"=>"April", "05"=>"May", "06"=>"June", "07"=>"July", "08"=>"August", "09"=>"September", "10"=>"October", "11"=>"November", "12"=>"December");
print_r($mons);
/*foreach($mons as $mm)
{
echo $mm;
}*/
$month_name = $mons[$mm];
echo "</br>".$month_name;
$days=cal_days_in_month(CAL_GREGORIAN, $mm, $year);
$dayss= $days-1;
echo $dayss."</br>";
$dayys=' + '.$dayss.' days' ;
$var=$from.$dayys;
//echo $var."</br>";
echo "Last".date('Y-m-d 23:59:59',strtotime($var));
?>
i'm getting Use of undefined constant - assumed error in the above code. I guess i got this issue due to non breaking spce but don't know where i left that? Kindly help!!