Skip to content
Create a gist now

Instantly share code, notes, and snippets.

PHP Date difference in Days
function dateDiff($start, $end) {
$start_ts = strtotime($start);
$end_ts = strtotime($end);
$diff = $end_ts - $start_ts;
return round($diff / 86400);
echo dateDiff("2012-01-28", "2012-01-27");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.