title: Sum time if date already exists or has a duplicate
body: <p>I have this array</p>
  
  <pre><code>$date = array{"2013-09-17 00:21:00",
                "2013-09-23 00:12:00",
                "2013-09-23 00:41:00",
                "2013-09-20 00:13:00",
                "2013-09-19 00:34:00",
                "2013-09-17 00:38:00"}
  </code></pre>
  
  <p>I'm trying to sum the time inside the array that have the same date.</p>
  
  <p>This is my expected output:</p>
  
  <pre><code> $date = array{"2013-09-17 00:59:00",
                 "2013-09-23 00:53:00", 
                 "2013-09-20 00:13:00",
                 "2013-09-19 00:34:00"}
  </code></pre>
  
  <p>Now this is what I have tried so far</p>
  
  <pre><code>foreach($date as $key =&gt; $value)
          {
              $lf_date[] = date("Y-m-d",strtotime($value));
              $lf_time[] = date("H:i:s",strtotime($value));
  
              if(isset($lf_date[$key]))
              {
                   $output[] += $lf_time[$key]; 
              }
              else
              {
                   $output[] = $lf_time[$key]; 
              }
  
          }
  </code></pre>
  
  <p>This gives me a 0 output T_T.. I already tried searching on google and it says that I have to use <strong>isset</strong> and <strong>array_key_exists</strong> but I can't get it to work. :(. Thanks for anyone who could help me. </p>