title: Count iterations of PHP DatePeriod()
body: <p>I understand how date period works with one exception, is there a way to find out from date period how many intervals there are?</p>
  
  <p>So for instance:</p>
  
  <pre><code>// define the period of the range
  $period = new DatePeriod($begin, $rangeType, $end);
  
  // iterate through the dates in range
  foreach ( $period as $dt ) {
  }
  </code></pre>
  
  <p>This is what I would like to do from the above code:</p>
  
  <pre><code>echo count($period);
  </code></pre>
  
  <p>Basically I want to know how many time the <code>foreach</code> loop will end up running.</p>