Getting the average of an array of dates differences using PHP
<p>So im trying to get the average time a user spends on my site using my own built analytics.<br>
I'm using DateTime class right now but the math seems very sketchy.  Say I have an array of login times and logout times.  </p>

<pre><code>$array = array(
    array("login" =&gt; '2012-01-31 10:35:58', "logout" =&gt; '2012-02-01 10:35:58'),
    array("login" =&gt; '2012-02-04 10:35:58', "logout" =&gt; '2012-02-05 10:35:58')
  );
</code></pre>

<p>I want to get the of amount of time between each login and logout.   Then get an average time of all those times.  </p>
