I'm going to write a function to print a number of days left between two dates. I would like it to tell the months and days left. For example:
45 days = 1month, 15 days
65 days = 2months, 5 days
10 days = 10 days
So I tried:
<?
$days=50;
if($days>"31"){
$time=$days/30;
}
echo $time;//1.67 month
?>
According to the code above. I expect the result to be like:
1 month, 20 days
Could you guys please suggest.