Or, if the format really is that returned by date('Y-m-d') you could just go
if($date1>$date2):
echo "Later";
elseif($date1<$date2)
echo "Before";
else
echo "Equal";
No, really. Think about it.
$date1 = date('Y-m-d', strtotime('last week'));
$date2 = date('Y-m-d', strtotime('next year'));
echo $date1.' '.$date2.': Date 1 is ';
echo ($date1>$date2)
? "later"
: ($date1<$date2)
? "earlier"
: "equal";
That's one reason the format is ISO standard.