I got this code from Stackoverflow and changed it slightly to work with today's date.
I want to check if today fits between two dates. But this is not working. What am I missing?
$paymentDate = date('d/m/Y');
echo $paymentDate; // echos today!
$contractDateBegin = date('d/m/Y', '01/01/2001');
$contractDateEnd = date('d/m/Y', '01/01/2015');
if ($paymentDate > $contractDateBegin && $paymentDate < $contractDateEnd)
{
echo "is between";
}
else
{
echo "NO GO!";
}
This is the right answer for your code. Just use the strtotime() php function.