Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嘿伙计们,所以我想知道日期,让我们说 Y-MM-DD,让我们说从上周到现在。
所以:
2013-4-8 到 2013-4-15 <-- 所以我想把这两者之间的距离变成一个整数,所以它应该是 7。
我的问题是如何获得该号码?
大卫
以时尚的方式:
$start = '2013-4-8'; $end = '2013-4-15'; $diff = count(range(strtotime($start), strtotime($end),86400))-1; echo $diff;
在线演示