【发布时间】:2013-01-07 12:56:07
【问题描述】:
我了解日期期间如何工作,但有一个例外,有没有办法从日期期间找出有多少间隔?
例如:
// define the period of the range
$period = new DatePeriod($begin, $rangeType, $end);
// iterate through the dates in range
foreach ( $period as $dt ) {
}
这是我想从上面的代码中做的:
echo count($period);
基本上我想知道foreach 循环将运行多少次。
【问题讨论】: