美文网首页
php 根据两个时间戳 循还出之间的日期

php 根据两个时间戳 循还出之间的日期

作者: 风度翩翩的程序猿 | 来源:发表于2022-04-16 13:35 被阅读0次
   // 计算出两个时间戳的日期
    function periodDate($start_time,$end_time){
        $start_time = strtotime($start_time);
        $end_time = strtotime($end_time);
        $i=0;
        while ($start_time<=$end_time){
            $arr[$i]=date('Y-m-d',$start_time);
            $start_time = strtotime('+1 day',$start_time);
            $i++;
        }
        return $arr;
    }

相关文章

网友评论

      本文标题:php 根据两个时间戳 循还出之间的日期

      本文链接:https://www.haomeiwen.com/subject/wofhertx.html