title: Working out average time
body: <p>I have an array of times as below:</p>
  
  <pre><code>Array
  (
      [0] =&gt; 00:00:04
      [1] =&gt; 00:00:05
      [2] =&gt; 00:00:02
      [3] =&gt; 00:00:09
      [4] =&gt; 00:00:03
      []...
  )
  </code></pre>
  
  <p>And I am trying to work out the average time using the code below:</p>
  
  <pre><code>foreach($times as $t) {          
      $unixtime += strtotime($t);      
  }      
  
  $unixtime = $unixtime / count($times);  
  
  echo "Unix Time: " . $unixtime . "&lt;br /&gt;";  
  echo "Formatted: " . date("h:i:s",$unixtime) . "&lt;p/&gt;"; 
  </code></pre>
  
  <p>But the output I am getting is:</p>
  
  <blockquote>
    <p>Unix Time: 1345669204.37 
    Formatted: 12:00:04</p>
  </blockquote>
  
  <p>Can anyone please tell me what I am doing wrong?</p>