怎么计算出开始日期到结果日期中间有哪些日期
Jun 23, 2016 pm 02:24 PM 怎么计算出开始日期到结果日期中间有哪些日期??
比如:
开始日期:2013-10-28
结束日期:2013-11-02
包含的日期就有:2013-10-28,2013-10-29,2013-10-30,2013-10-31,2013-11-01,2013-11-02
开始日期:2013-12-29
结束日期:2014-01-02
包含的日期就有:2013-12-29,2013-12-30,2013-12-31,2014-01-01,2014-01-02
回复讨论(解决方案)
使用 mktime 函数不停的加
$start='2013-10-28';$end='2013-11-02';while($start<=$end){ echo $start.'<br>'; $start=date("Y-m-d",strtotime("$start +1 day"));}

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

11 Best PHP URL Shortener Scripts (Free and Premium)

Working with Flash Session Data in Laravel

Build a React App With a Laravel Back End: Part 2, React

Simplified HTTP Response Mocking in Laravel Tests

cURL in PHP: How to Use the PHP cURL Extension in REST APIs

12 Best PHP Chat Scripts on CodeCanyon
