Date1=23-3-2013
Date2=26-3-2013
How to compare above both date such as If Date2 >= Date1 Echo greater them equal to
Else
Echo not greater them equal to
Here greater does not means mathematically greater
Date1=23-3-2013
Date2=26-3-2013
How to compare above both date such as If Date2 >= Date1 Echo greater them equal to
Else
Echo not greater them equal to
Here greater does not means mathematically greater
Use the function strtotime($date)
Therefore, you would have something like:
if(strtotime($date1) < strtotime($date2)){
echo Date 2 is greater than date 1;
}else{
echo Date 1 is greater or equal than Date 2;
}