Possible Duplicate:
How to check if a date is in a given range?
How to check if date(entered by user) is in given range (Date format :-day month ie.:-1 june )
I am trying to find whether a date is in defined range. I'm using the following code:
$apple='25 March';
$udate= date('d F',strtotime($apple));
echo $udate;
$startDate='21 March';
$realStartDate= date('d F',strtotime($startDate)) ;
echo $realStartDate;
$endDate='19 April';
$realEndDate= date('d F',strtotime($endDate)) ;
if ($udate >= $realStartDate && $udate <= $realEndDate ) {
echo 'within tange';
}
else{
echo 'Not in range';
}
?>
Where am I going wrong?