Comparação de datas no PHP
<?php
//Oficial Docs: http://php.net/manual/pt_BR/datetime.diff.php
$datetime1 = new DateTime('2009-10-11');
$datetime2 = new DateTime('2009-10-13');
$interval = $datetime1->diff($datetime2);
echo $interval->format('%a days');