How to display how many weeks and days left when a start date and an end date is given?

Following code in php displays how many weeks and days left when a start date and an end date is given:
function daysWeeks($start,$end)
{
$days_left=$end-$start;
$weeks = (int) ($days_left / 7) ;
$days = $days_left % 7;
echo “$weeks weeks and $days days left!”;
}
$start=”05/08/2008″;
$end=”25/08/2008″;
daysWeeks($start,$end);

Leave a Reply