title: Sum values in array and simplify key names
body: <p>This is almost similar to my other question which is related to the same project I'm working on.. <a href="https://stackoverflow.com/questions/25046786/count-data-in-array-where-date-is-the-same-and-build-chart-bar-morrisjs">Link to my other question</a><br>
  but in this case the array is different as follow:<br></p>
  
  <pre><code>Array
  (
      [2014-08-01 11:27:03] =&gt; 2
      [2014-08-01 11:52:57] =&gt; 2
      [2014-08-01 11:54:49] =&gt; 2
      [2014-08-02 11:59:54] =&gt; 4
      [2014-08-02 12:02:41] =&gt; 2
      [2014-08-05 12:09:38] =&gt; 4
      [2014-08-07 12:23:12] =&gt; 3
      [2014-08-07 12:25:18] =&gt; 3
  // and so on...
  )
  </code></pre>
  
  <p>That is my output array and in order to get that array I had to do some miracles... anyway, so based on that array I have to sum the value for each key date and build an array something like this...</p>
  
  <pre><code>Array
  (
      [2014-08-01] =&gt; 6
      [2014-08-02] =&gt; 6
      [2014-08-05] =&gt; 4
      [2014-08-07] =&gt; 6
  // and so on...
  )
  </code></pre>
  
  <p>That last array will be use to build graphs with morrisonJS, what I have is this:<br></p>
  
  <pre><code>$res_meno = array();
  foreach ($sunArr as $keys =&gt; $values) {
      $arrays= explode(" ",$sumArr[$keys]);
      $res_meno[] = $arrays[0];
  }
  $vals_char2 = array_count_values($res_meno); 
  </code></pre>
  
  <p>That is my attempt to build my last array but is not working...<br>
  any help would be greatly appreciated!<br></p>
  
  <p>Thank you for taking the time.</p>