Skip to content

Instantly share code, notes, and snippets.

@kidatti
Created July 27, 2015 03:59
Show Gist options
  • Save kidatti/a6bb9308ad87d56e4d98 to your computer and use it in GitHub Desktop.
Save kidatti/a6bb9308ad87d56e4d98 to your computer and use it in GitHub Desktop.
2つの日付から日数を算出
function diff_day($date1, $date2) {
$num1 = strtotime($date1);
$num2 = strtotime($date2);
$num_diff = $num2 - $num1;
$day_diff = $num_diff / (60 * 60 * 24);
return $day_diff;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment