This small php snippet will help you to find the difference between two given dates
 
function d_diff($start, $end) {
 $start_ts = strtotime($start);
 $end_ts = strtotime($end);
 $diff = $end_ts - $start_ts;

 return round($diff / 86400);
}

echo d_diff("10-3-2011","29-3-2012"). ‘ days’;

This d_diff function takes start and end date as parameters and  calculates no. of days between two dates.
 


Comments (0)
Leave a Comment

loader Posting your comment...