- floor: documentation ( source)
- date: documentation ( source)
- strtotime: documentation ( source)
<?php
function is_fastbonus($reg_date){
$reg_date = $reg_date->format('Y-m-d');
$expire = date('Y-m-d', strtotime($reg_date.' + 60 days'));
$diff = strtotime($expire) - strtotime(date('Y-m-d'));
$daysleft = floor( $diff / (60 * 60 * 24) );
if($daysleft > 0)
return $daysleft;
else
return FALSE;
}
echo is_fastbonus('2014-04-01');