tp5 计算两个日期之间相差的天数

//两个日期之间相差的天数
function diffBetweenTwoDays ($day1, $day2)
{
$second1 = strtotime($day1);
$second2 = strtotime($day2); if ($second1 < $second2) {
$tmp = $second2;
$second2 = $second1;
$second1 = $tmp;
}
return ($second1 - $second2) / 86400;
}
$day1 = "2013-07-27";
$day2 = "2013-08-04";
$diff = diffBetweenTwoDays($day1, $day2);
echo $diff."\n";
上一篇:对FileUpload文件上传控件的一些使用方法说明


下一篇:Android初涉及之Android Studio&JAVA入门--二月不能不写东西