Count the number of days between two dates with PHP

It might be very useful to count the number of days between the two dates. The calculation is quite straight forward

<?php

function dateDiff($start, $end) {

$start_ts = strtotime($start);

$end_ts = strtotime($end);

$difference = $end_ts - $start_ts;

return round($difference / 86400);

}

echo dateDiff("2010-05-05", "2010-07-09");

?>