1 2 3 4 5 6 7 8 9
<?php $total_days = 300; $total_years = intval($total_days / 365); $remaining_days = ($total_days % 365) % 30; if ($total_days < 365) { $remaining_days = $total_days; } echo $total_years.' years and '.$remaining_days.' days'; ?>
1
0 years and 300 days