- floor: documentation ( source)
- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$expira = date('Y-m-d', strtotime('2013-04-01 + 182 days'));
echo strtotime(date('Y-m-d')). '<' ;
$diff = strtotime($expira) - strtotime(date('Y-m-d'));
$daysleft=floor($diff/(60*60*24));
echo "$daysleft days left";
?>