php判断两个日期相差多少天源代码

<?php
$a=$_POST['rq1'];
$b=$_POST['rq2'];
date_default_timezone_set('UTC');
echo $a.'<br>';
echo $b.'<br>';
strtotime('2020-01-01 23:00:00');
$d=strtotime("$a");
$e=strtotime("$b");
//$c=$d-$e;
$c= ($d - $e)/ 86400;
echo '相差'.$c."天";

猜你喜欢

转载自blog.csdn.net/qq_25645753/article/details/107884615
今日推荐